fix: memory leak

This commit is contained in:
Liu Jicong 2022-11-26 16:05:26 +08:00
parent efe7b5c3e2
commit 22372ad1e0
1 changed files with 3 additions and 0 deletions

View File

@ -291,6 +291,7 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
STqHandle handle;
tDecoderInit(&decoder, (uint8_t*)pVal, vLen);
tDecodeSTqHandle(&decoder, &handle);
tDecoderClear(&decoder);
handle.pRef = walOpenRef(pTq->pVnode->pWal);
if (handle.pRef == NULL) {
@ -345,6 +346,8 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
taosHashPut(pTq->pHandle, pKey, kLen, &handle, sizeof(STqHandle));
}
tdbFree(pKey);
tdbFree(pVal);
tdbTbcClose(pCur);
return 0;
}