diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index d96b260b13cf8a1bbcbc9b329a51bc1a714aba8d..1ed63be07070f4cad357025a92b5e2413af3f639 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;