fix: more ret check

This commit is contained in:
Shungang Li 2024-06-25 11:36:55 +08:00
parent 2292829e47
commit 41021285a1
1 changed files with 16 additions and 2 deletions

View File

@ -12665,6 +12665,10 @@ static int32_t buildTagIndexForBindTags(SMsgBuf* pMsgBuf, SCreateSubTableFromFil
SSchema* pSchema = getTableTagSchema(pSuperTableMeta); SSchema* pSchema = getTableTagSchema(pSuperTableMeta);
SHashObj* pIdxHash = taosHashInit(16, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK); SHashObj* pIdxHash = taosHashInit(16, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK);
if (NULL == pIdxHash) {
return TSDB_CODE_OUT_OF_MEMORY;
}
bool tbnameFound = false; bool tbnameFound = false;
SNode* pTagNode; SNode* pTagNode;
@ -12716,14 +12720,24 @@ static int32_t buildTagIndexForBindTags(SMsgBuf* pMsgBuf, SCreateSubTableFromFil
if (code) break; if (code) break;
taosHashPut(pIdxHash, &idx, sizeof(idx), NULL, 0); if (taosHashPut(pIdxHash, &idx, sizeof(idx), NULL, 0) < 0) {
taosArrayPush(pStmt->aTagIndexs, &idx); parserError("buildTagIndexForBindTags error, failed to put idx");
code = terrno;
goto _OUT;
}
if (NULL == taosArrayPush(pStmt->aTagIndexs, &idx)) {
parserError("buildTagIndexForBindTags error, failed to push idx");
code = TSDB_CODE_OUT_OF_MEMORY;
goto _OUT;
}
} }
if (!tbnameFound) { if (!tbnameFound) {
code = generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_TBNAME_ERROR); code = generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_TBNAME_ERROR);
} }
_OUT:
taosHashCleanup(pIdxHash); taosHashCleanup(pIdxHash);
return code; return code;
} }