From 90fac9b8da70a11ccb6ddcbbe3cf03fc298cb0b7 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 15 Sep 2022 21:11:12 +0800 Subject: [PATCH] fix(tsc): avoid mem leak --- source/client/src/clientMsgHandler.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/client/src/clientMsgHandler.c b/source/client/src/clientMsgHandler.c index ebccc5ea1a..cdf977bea3 100644 --- a/source/client/src/clientMsgHandler.c +++ b/source/client/src/clientMsgHandler.c @@ -47,6 +47,7 @@ int32_t genericRspCallback(void* param, SDataBuf* pMsg, int32_t code) { int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { SRequestObj* pRequest = param; if (code != TSDB_CODE_SUCCESS) { + taosMemoryFree(pMsg->pEpSet); taosMemoryFree(pMsg->pData); setErrno(pRequest, code); tsem_post(&pRequest->body.rspSem); @@ -72,6 +73,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { /*assert(connectRsp.epSet.numOfEps > 0);*/ if (connectRsp.epSet.numOfEps == 0) { + taosMemoryFree(pMsg->pEpSet); taosMemoryFree(pMsg->pData); setErrno(pRequest, TSDB_CODE_MND_APP_ERROR); tsem_post(&pRequest->body.rspSem); -- GitLab