From bd87ba990ca74daccaa2a3ae21b607e70e7e7e28 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 5 Nov 2020 23:08:42 +0800 Subject: [PATCH] [TD-225] fix memory leak. --- src/query/src/qAst.c | 1 - src/query/src/qExecutor.c | 3 ++- src/query/src/qFill.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/query/src/qAst.c b/src/query/src/qAst.c index 847a8b8eb6..bc2866fb6f 100644 --- a/src/query/src/qAst.c +++ b/src/query/src/qAst.c @@ -32,7 +32,6 @@ #include "tstoken.h" #include "ttokendef.h" #include "tulog.h" -#include "tutil.h" /* * diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index b365dc4283..b992a037ed 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -1609,7 +1609,7 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int16_t order pRuntimeEnv->pCtx = (SQLFunctionCtx *)calloc(pQuery->numOfOutput, sizeof(SQLFunctionCtx)); pRuntimeEnv->rowCellInfoOffset = calloc(pQuery->numOfOutput, sizeof(int32_t)); - pRuntimeEnv->pResultRow = getNewResultRow(pRuntimeEnv->pool);//calloc(1, sizeof(SResultRow)); + pRuntimeEnv->pResultRow = getNewResultRow(pRuntimeEnv->pool); if (pRuntimeEnv->pResultRow == NULL || pRuntimeEnv->pCtx == NULL || pRuntimeEnv->rowCellInfoOffset == NULL) { goto _clean; @@ -1745,6 +1745,7 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) { pRuntimeEnv->pTSBuf = tsBufDestroy(pRuntimeEnv->pTSBuf); taosTFree(pRuntimeEnv->keyBuf); + taosTFree(pRuntimeEnv->rowCellInfoOffset); taosHashCleanup(pRuntimeEnv->pResultRowHashTable); pRuntimeEnv->pResultRowHashTable = NULL; diff --git a/src/query/src/qFill.c b/src/query/src/qFill.c index a219bd6abd..788779b2bb 100644 --- a/src/query/src/qFill.c +++ b/src/query/src/qFill.c @@ -170,7 +170,7 @@ int64_t getFilledNumOfRes(SFillInfo* pFillInfo, TSKEY ekey, int32_t maxNumOfRows int32_t numOfRows = taosNumOfRemainRows(pFillInfo); TSKEY ekey1 = ekey; - if (pFillInfo->order != TSDB_ORDER_ASC) { + if (!FILL_IS_ASC_FILL(pFillInfo)) { pFillInfo->endKey = taosTimeTruncate(ekey, &pFillInfo->interval, pFillInfo->precision); } -- GitLab