From 7a62409dc171dd1afeb174c3dd0e38022b984157 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 20 Jul 2022 13:54:06 +0800 Subject: [PATCH] fix: fix taosd mem leak --- source/libs/executor/src/executorimpl.c | 6 +++--- source/libs/executor/src/scanoperator.c | 1 + source/libs/index/src/indexFilter.c | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index d3a7fc51eb..885c6d7458 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -4284,7 +4284,7 @@ int32_t generateGroupIdMap(STableListInfo* pTableListInfo, SReadHandle* pHandle, REPLACE_NODE(pNew); } else { taosMemoryFree(keyBuf); - nodesClearList(groupNew); + nodesDestroyList(groupNew); metaReaderClear(&mr); return code; } @@ -4302,7 +4302,7 @@ int32_t generateGroupIdMap(STableListInfo* pTableListInfo, SReadHandle* pHandle, if (tTagIsJson(data)) { terrno = TSDB_CODE_QRY_JSON_IN_GROUP_ERROR; taosMemoryFree(keyBuf); - nodesClearList(groupNew); + nodesDestroyList(groupNew); metaReaderClear(&mr); return terrno; } @@ -4325,7 +4325,7 @@ int32_t generateGroupIdMap(STableListInfo* pTableListInfo, SReadHandle* pHandle, info->groupId = groupId; groupNum++; - nodesClearList(groupNew); + nodesDestroyList(groupNew); metaReaderClear(&mr); } taosMemoryFree(keyBuf); diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 6dc998e078..c78788aa5c 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -359,6 +359,7 @@ void setTbNameColData(void* pMeta, const SSDataBlock* pBlock, SColumnInfoData* p SScalarParam param = {.columnData = pColInfoData}; fpSet.process(&srcParam, 1, ¶m); + colDataDestroy(&infoData); } static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) { diff --git a/source/libs/index/src/indexFilter.c b/source/libs/index/src/indexFilter.c index eadccba35f..27c90af3e7 100644 --- a/source/libs/index/src/indexFilter.c +++ b/source/libs/index/src/indexFilter.c @@ -707,6 +707,8 @@ static int32_t sifCalculate(SNode *pNode, SIFParam *pDst) { sifFreeParam(res); taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES); } + sifFreeRes(ctx.pRes); + SIF_RET(code); }