diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index c5496cffb0..a268a3547a 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -6924,7 +6924,9 @@ void tDestroySVCreateTbReq(SVCreateTbReq *pReq, int32_t flags) { } } - taosMemoryFree(pReq->sql); + if(pReq->sql != NULL){ + taosMemoryFree(pReq->sql); + } pReq->sql = NULL; } diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index e9abacfb61..bafc060331 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -694,10 +694,12 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) { if (pTopic == NULL) { if (dropReq.igNotExists) { mInfo("topic:%s, not exist, ignore not exist is set", dropReq.name); + tFreeSMDropTopicReq(&dropReq); return 0; } else { terrno = TSDB_CODE_MND_TOPIC_NOT_EXIST; mError("topic:%s, failed to drop since %s", dropReq.name, terrstr()); + tFreeSMDropTopicReq(&dropReq); return -1; } }