Merge pull request #27068 from taosdata/fix/fixTransportMemleak
fix mem leak
This commit is contained in:
commit
8226a06316
|
@ -1620,15 +1620,18 @@ static void cliHandleFreeById(SCliMsg* pMsg, SCliThrd* pThrd) {
|
|||
if (size == 0) {
|
||||
// already recv, and notify upper layer
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_REF_INVALID_ID, NULL, _exception);
|
||||
return;
|
||||
} else {
|
||||
while (T_REF_VAL_GET(conn) >= 1) transUnrefCliHandle(conn);
|
||||
while (T_REF_VAL_GET(conn) >= 1) {
|
||||
transUnrefCliHandle(conn);
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
_exception:
|
||||
tDebug("already free conn %p by id %" PRId64"", conn, refId);
|
||||
|
||||
(void)transReleaseExHandle(transGetRefMgt(), refId);
|
||||
(void)transReleaseExHandle(transGetRefMgt(), refId);
|
||||
(void)transRemoveExHandle(transGetRefMgt(), refId);
|
||||
destroyCmsg(pMsg);
|
||||
}
|
||||
|
||||
|
@ -2225,6 +2228,11 @@ static FORCE_INLINE void destroyCmsgAndAhandle(void* param) {
|
|||
pThrd->destroyAhandleFp(pMsg->ctx->ahandle);
|
||||
}
|
||||
|
||||
if (pMsg->msg.info.handle !=0) {
|
||||
(void)transReleaseExHandle(transGetRefMgt(), (int64_t)pMsg->msg.info.handle);
|
||||
(void)transRemoveExHandle(transGetRefMgt(), (int64_t)pMsg->msg.info.handle);
|
||||
}
|
||||
|
||||
transDestroyConnCtx(pMsg->ctx);
|
||||
transFreeMsg(pMsg->msg.pCont);
|
||||
taosMemoryFree(pMsg);
|
||||
|
|
Loading…
Reference in New Issue