fix: avoid invalid read/write

This commit is contained in:
yihaoDeng 2022-06-07 17:57:26 +08:00
parent 56f7b46ae7
commit 991b5c7b40
1 changed files with 3 additions and 1 deletions

View File

@ -70,6 +70,9 @@ static int metaSaveJsonVarToIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const
char * key = pTagVal->pKey;
int32_t nKey = strlen(key);
if (nKey == 0) {
continue;
}
SIndexTerm *term = NULL;
if (type == TSDB_DATA_TYPE_NULL) {
@ -98,7 +101,6 @@ static int metaSaveJsonVarToIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const
if (term != NULL) {
indexMultiTermAdd(terms, term);
}
memset(key, 0, sizeof(key));
}
tIndexJsonPut(pMeta->pTagIvtIdx, terms, tuid);
indexMultiTermDestroy(terms);