From f385b1900223004c27c2c4b68839ac0d04f09d3e Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Thu, 29 Jul 2021 16:41:30 +0800 Subject: [PATCH] [TD-5633]:fix memory leak of intermediate result buf --- src/query/src/qAggMain.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index d96b260b13..1ed63be070 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -4132,6 +4132,11 @@ void blockinfo_func_finalizer(SQLFunctionCtx* pCtx) { pDist->rowSize = (uint16_t)pCtx->param[0].i64; generateBlockDistResult(pDist, pCtx->pOutput); + if (pDist->dataBlockInfos != NULL) { + taosArrayDestroy(pDist->dataBlockInfos); + pDist->dataBlockInfos = NULL; + } + // cannot set the numOfIteratedElems again since it is set during previous iteration pResInfo->numOfRes = 1; pResInfo->hasResult = DATA_SET_FLAG; -- GitLab