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

This commit is contained in:
Haojun Liao 2020-12-12 19:25:05 +08:00
parent ccc78f9f6a
commit c55c464664
1 changed files with 3 additions and 1 deletions

View File

@ -407,7 +407,9 @@ void tscResetSqlCmdObj(SSqlCmd* pCmd, bool removeFromCache) {
pCmd->autoCreated = 0; pCmd->autoCreated = 0;
for(int32_t i = 0; i < pCmd->numOfTables; ++i) { 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; pCmd->numOfTables = 0;