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) {
|
if (size == 0) {
|
||||||
// already recv, and notify upper layer
|
// already recv, and notify upper layer
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_REF_INVALID_ID, NULL, _exception);
|
TAOS_CHECK_GOTO(TSDB_CODE_REF_INVALID_ID, NULL, _exception);
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
while (T_REF_VAL_GET(conn) >= 1) transUnrefCliHandle(conn);
|
while (T_REF_VAL_GET(conn) >= 1) {
|
||||||
|
transUnrefCliHandle(conn);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
_exception:
|
_exception:
|
||||||
tDebug("already free conn %p by id %" PRId64"", conn, refId);
|
tDebug("already free conn %p by id %" PRId64"", conn, refId);
|
||||||
|
|
||||||
(void)transReleaseExHandle(transGetRefMgt(), refId);
|
(void)transReleaseExHandle(transGetRefMgt(), refId);
|
||||||
|
(void)transReleaseExHandle(transGetRefMgt(), refId);
|
||||||
|
(void)transRemoveExHandle(transGetRefMgt(), refId);
|
||||||
destroyCmsg(pMsg);
|
destroyCmsg(pMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2225,6 +2228,11 @@ static FORCE_INLINE void destroyCmsgAndAhandle(void* param) {
|
||||||
pThrd->destroyAhandleFp(pMsg->ctx->ahandle);
|
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);
|
transDestroyConnCtx(pMsg->ctx);
|
||||||
transFreeMsg(pMsg->msg.pCont);
|
transFreeMsg(pMsg->msg.pCont);
|
||||||
taosMemoryFree(pMsg);
|
taosMemoryFree(pMsg);
|
||||||
|
|
Loading…
Reference in New Issue