From 804e6e95f331ac437c77de32988d68cd15b0bebd Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Mon, 20 Jun 2022 13:26:19 +0800 Subject: [PATCH] fix: a problem of tag condition double free --- source/libs/nodes/src/nodesUtilFuncs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index b0c2aa7407..3561a7f8ea 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -1764,7 +1764,14 @@ int32_t nodesPartitionCond(SNode** pCondition, SNode** pPrimaryKeyCond, SNode** *pTagIndexCond = *pCondition; } if (NULL != pTagCond) { - *pTagCond = *pCondition; + SNode* pTempCond = *pCondition; + if (NULL != pTagIndexCond) { + pTempCond = nodesCloneNode(*pCondition); + if (NULL == pTempCond) { + return TSDB_CODE_OUT_OF_MEMORY; + } + } + *pTagCond = pTempCond; } break; case COND_TYPE_TAG: -- GitLab