From 338f9cd32db36892080a9f1fef1385c8b43fc41c Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 24 Sep 2024 14:30:28 +0800 Subject: [PATCH] fix possible mem leak --- source/libs/transport/src/transCli.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 695f523f6e..60c75360c1 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -493,10 +493,6 @@ void cliHandleResp(SCliConn* conn) { } if (CONN_NO_PERSIST_BY_APP(conn)) { - if (refId != 0) { - (void)transReleaseExHandle(transGetRefMgt(), refId); - (void)transRemoveExHandle(transGetRefMgt(), refId); - } return addConnToPool(pThrd->pool, conn); } @@ -3361,6 +3357,9 @@ int32_t transFreeConnById(void* shandle, int64_t transpointId) { _exception: transReleaseExHandle(transGetInstMgt(), (int64_t)shandle); + + (void)transReleaseExHandle(transGetRefMgt(), transpointId); + (void)transRemoveExHandle(transGetRefMgt(), transpointId); taosMemoryFree(pCli); return code;