From 3572520d1962b3204ef8f54c111f43845580b2b0 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Mon, 11 Jul 2022 19:34:30 +0800 Subject: [PATCH] fix: memory leak fix during creation of tsma --- source/dnode/mnode/impl/src/mndSma.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index c1513cd92f..c040f0d05b 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -204,6 +204,8 @@ _OVER: mError("sma:%s, failed to decode from raw:%p since %s", pSma->name, pRaw, terrstr()); taosMemoryFreeClear(pSma->expr); taosMemoryFreeClear(pSma->tagsFilter); + taosMemoryFreeClear(pSma->sql); + taosMemoryFreeClear(pSma->ast); taosMemoryFreeClear(pRow); return NULL; } @@ -221,6 +223,8 @@ static int32_t mndSmaActionDelete(SSdb *pSdb, SSmaObj *pSma) { mTrace("sma:%s, perform delete action, row:%p", pSma->name, pSma); taosMemoryFreeClear(pSma->tagsFilter); taosMemoryFreeClear(pSma->expr); + taosMemoryFreeClear(pSma->sql); + taosMemoryFreeClear(pSma->ast); return 0; } -- GitLab