From bcba01832484a9492a5718e0199a586596f8cca7 Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao> Date: Fri, 23 Aug 2024 11:36:47 +0800 Subject: [PATCH 1/2] fix mem leak --- source/libs/executor/src/timesliceoperator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index f48393273f..6ea242f733 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -1247,6 +1247,10 @@ void destroyTimeSliceOperatorInfo(void* param) { taosMemoryFree(pInfo->pPrevGroupKey->pData); taosMemoryFree(pInfo->pPrevGroupKey); } + if (pInfo->hasPk) { + taosMemoryFreeClear(pInfo->prevKey.pks[0].pData); + taosMemoryFreeClear(pInfo->prevKey.pks[1].pData); + } cleanupExprSupp(&pInfo->scalarSup); if (pInfo->pFillColInfo != NULL) { From 41220ef3db5b9ad6406773fdef57abf86cedbcfb Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao> Date: Fri, 23 Aug 2024 13:23:01 +0800 Subject: [PATCH 2/2] fix mem leak --- source/libs/executor/src/timesliceoperator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index 6ea242f733..7f23255257 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -1247,9 +1247,8 @@ void destroyTimeSliceOperatorInfo(void* param) { taosMemoryFree(pInfo->pPrevGroupKey->pData); taosMemoryFree(pInfo->pPrevGroupKey); } - if (pInfo->hasPk) { + if (pInfo->hasPk && IS_VAR_DATA_TYPE(pInfo->pkCol.type)) { taosMemoryFreeClear(pInfo->prevKey.pks[0].pData); - taosMemoryFreeClear(pInfo->prevKey.pks[1].pData); } cleanupExprSupp(&pInfo->scalarSup);