From c55c4646644b1c8e4c1105a4e34104cc5c4856fe Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 12 Dec 2020 19:25:05 +0800 Subject: [PATCH] [TD-225] release the ref if insertion succeeds. --- src/client/src/tscUtil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index b7fe6aa7b2..4004e0f3ea 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -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; -- GitLab