提交 802ca0f6 编写于 作者: H Haojun Liao

fix(query): fix memory leak.

上级 c6795b68
...@@ -90,6 +90,12 @@ static void statsCacheClose(SMeta* pMeta) { ...@@ -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 metaCacheOpen(SMeta* pMeta) {
int32_t code = 0; int32_t code = 0;
SMetaCache* pCache = NULL; SMetaCache* pCache = NULL;
...@@ -132,6 +138,7 @@ int32_t metaCacheOpen(SMeta* pMeta) { ...@@ -132,6 +138,7 @@ int32_t metaCacheOpen(SMeta* pMeta) {
goto _err2; goto _err2;
} }
taosHashSetFreeFp(pCache->sTagFilterResCache.pTableEntry, freeCacheEntryFp);
pMeta->pCache = pCache; pMeta->pCache = pCache;
return code; return code;
......
...@@ -1017,6 +1017,7 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode, ...@@ -1017,6 +1017,7 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
metaUidFilterCachePut(metaHandle, pScanNode->suid, context.digest, tListLen(context.digest), pPayload, metaUidFilterCachePut(metaHandle, pScanNode->suid, context.digest, tListLen(context.digest), pPayload,
size, 1); size, 1);
taosMemoryFree(pPayload);
} else { } else {
qDebug("retrieve table uid list from cache, numOfTables:%d", (int32_t) taosArrayGetSize(res)); qDebug("retrieve table uid list from cache, numOfTables:%d", (int32_t) taosArrayGetSize(res));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册