From f9bc29d1490c5d95b805c3891b146407ee5907ed Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 21 Jul 2022 10:19:48 +0800 Subject: [PATCH] fix: memory leak problems of parser and planner --- source/libs/parser/src/parUtil.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index 8eed02bbbe..f98b195039 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -865,12 +865,15 @@ STableCfg* tableCfgDup(STableCfg* pCfg) { STableCfg* pNew = taosMemoryMalloc(sizeof(*pNew)); memcpy(pNew, pCfg, sizeof(*pNew)); - if (pNew->pComment) { + if (NULL != pNew->pComment) { pNew->pComment = strdup(pNew->pComment); } - if (pNew->pFuncs) { + if (NULL != pNew->pFuncs) { pNew->pFuncs = taosArrayDup(pNew->pFuncs); } + if (NULL != pNew->pTags) { + pNew->pTags = strdup(pNew->pTags); + } int32_t schemaSize = (pCfg->numOfColumns + pCfg->numOfTags) * sizeof(SSchema);