未验证 提交 70f74c3f 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #18848 from taosdata/fix/exHandleMemleak

fix: exhandle mem leak
...@@ -589,6 +589,7 @@ static void addConnToPool(void* pool, SCliConn* conn) { ...@@ -589,6 +589,7 @@ static void addConnToPool(void* pool, SCliConn* conn) {
} }
static int32_t allocConnRef(SCliConn* conn, bool update) { static int32_t allocConnRef(SCliConn* conn, bool update) {
if (update) { if (update) {
transReleaseExHandle(transGetRefMgt(), conn->refId);
transRemoveExHandle(transGetRefMgt(), conn->refId); transRemoveExHandle(transGetRefMgt(), conn->refId);
conn->refId = -1; conn->refId = -1;
} }
...@@ -697,6 +698,7 @@ static void cliDestroyConn(SCliConn* conn, bool clear) { ...@@ -697,6 +698,7 @@ static void cliDestroyConn(SCliConn* conn, bool clear) {
tTrace("%s conn %p remove from conn pool", CONN_GET_INST_LABEL(conn), conn); tTrace("%s conn %p remove from conn pool", CONN_GET_INST_LABEL(conn), conn);
QUEUE_REMOVE(&conn->q); QUEUE_REMOVE(&conn->q);
QUEUE_INIT(&conn->q); QUEUE_INIT(&conn->q);
transReleaseExHandle(transGetRefMgt(), conn->refId);
transRemoveExHandle(transGetRefMgt(), conn->refId); transRemoveExHandle(transGetRefMgt(), conn->refId);
conn->refId = -1; conn->refId = -1;
...@@ -731,6 +733,7 @@ static void cliDestroy(uv_handle_t* handle) { ...@@ -731,6 +733,7 @@ static void cliDestroy(uv_handle_t* handle) {
conn->timer = NULL; conn->timer = NULL;
} }
transReleaseExHandle(transGetRefMgt(), conn->refId);
transRemoveExHandle(transGetRefMgt(), conn->refId); transRemoveExHandle(transGetRefMgt(), conn->refId);
taosMemoryFree(conn->ip); taosMemoryFree(conn->ip);
taosMemoryFree(conn->stream); taosMemoryFree(conn->stream);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册