fix(query): fix memory leak.
This commit is contained in:
parent
c6795b68d2
commit
802ca0f607
|
@ -90,6 +90,12 @@ static void statsCacheClose(SMeta* pMeta) {
|
|||
}
|
||||
}
|
||||
|
||||
static void freeCacheEntryFp(void* param) {
|
||||
STagFilterResEntry** p = param;
|
||||
tdListEmpty(&(*p)->list);
|
||||
taosMemoryFreeClear(*p);
|
||||
}
|
||||
|
||||
int32_t metaCacheOpen(SMeta* pMeta) {
|
||||
int32_t code = 0;
|
||||
SMetaCache* pCache = NULL;
|
||||
|
@ -132,6 +138,7 @@ int32_t metaCacheOpen(SMeta* pMeta) {
|
|||
goto _err2;
|
||||
}
|
||||
|
||||
taosHashSetFreeFp(pCache->sTagFilterResCache.pTableEntry, freeCacheEntryFp);
|
||||
pMeta->pCache = pCache;
|
||||
return code;
|
||||
|
||||
|
|
|
@ -1017,6 +1017,7 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
|
|||
|
||||
metaUidFilterCachePut(metaHandle, pScanNode->suid, context.digest, tListLen(context.digest), pPayload,
|
||||
size, 1);
|
||||
taosMemoryFree(pPayload);
|
||||
} else {
|
||||
qDebug("retrieve table uid list from cache, numOfTables:%d", (int32_t) taosArrayGetSize(res));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue