Merge pull request #18165 from taosdata/fix/TD-20443

fix: free value return by tdb
This commit is contained in:
Shengliang Guan 2022-11-15 17:03:23 +08:00 committed by GitHub
commit d07209a4e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -179,6 +179,7 @@ int32_t tqMetaRestoreCheckInfo(STQ* pTq) {
if (tDecodeSTqCheckInfo(&decoder, &info) < 0) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
tdbFree(pKey);
tdbFree(pVal);
tdbTbcClose(pCur);
return -1;
}
@ -186,11 +187,13 @@ int32_t tqMetaRestoreCheckInfo(STQ* pTq) {
if (taosHashPut(pTq->pCheckInfo, info.topic, strlen(info.topic), &info, sizeof(STqCheckInfo)) < 0) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
tdbFree(pKey);
tdbFree(pVal);
tdbTbcClose(pCur);
return -1;
}
}
tdbFree(pKey);
tdbFree(pVal);
tdbTbcClose(pCur);
return 0;
}