[TD-225] release the ref if insertion succeeds.

This commit is contained in:
Haojun Liao 2020-12-12 19:24:18 +08:00
parent aafb60988b
commit af02383613
1 changed files with 3 additions and 1 deletions

View File

@ -407,7 +407,9 @@ void tscResetSqlCmdObj(SSqlCmd* pCmd, bool removeFromCache) {
pCmd->autoCreated = 0;
for(int32_t i = 0; i < pCmd->numOfTables; ++i) {
taosCacheRelease(tscMetaCache, (void**)&(pCmd->pTableMetaList[i]), false);
if (pCmd->pTableMetaList[i] != NULL) {
taosCacheRelease(tscMetaCache, (void**)&(pCmd->pTableMetaList[i]), false);
}
}
pCmd->numOfTables = 0;