提交 015dd658 编写于 作者: dengyihao's avatar dengyihao

fix: invalid read

上级 9c050c0e
...@@ -736,6 +736,9 @@ static void cliDestroy(uv_handle_t* handle) { ...@@ -736,6 +736,9 @@ static void cliDestroy(uv_handle_t* handle) {
conn->timer->data = NULL; conn->timer->data = NULL;
conn->timer = NULL; conn->timer = NULL;
} }
int32_t* oVal = taosHashGet(pThrd->connLimitCache, conn->ip, strlen(conn->ip));
int32_t nVal = oVal == NULL ? 0 : (*oVal) - 1;
taosHashPut(pThrd->connLimitCache, conn->ip, strlen(conn->ip), &nVal, sizeof(nVal));
atomic_sub_fetch_32(&pThrd->connCount, 1); atomic_sub_fetch_32(&pThrd->connCount, 1);
...@@ -750,10 +753,6 @@ static void cliDestroy(uv_handle_t* handle) { ...@@ -750,10 +753,6 @@ static void cliDestroy(uv_handle_t* handle) {
transReqQueueClear(&conn->wreqQueue); transReqQueueClear(&conn->wreqQueue);
transDestroyBuffer(&conn->readBuf); transDestroyBuffer(&conn->readBuf);
int32_t* oVal = taosHashGet(pThrd->connLimitCache, conn->ip, strlen(conn->ip));
int32_t nVal = oVal == NULL ? 0 : (*oVal) - 1;
taosHashPut(pThrd->connLimitCache, conn->ip, strlen(conn->ip), &nVal, sizeof(nVal));
taosMemoryFree(conn); taosMemoryFree(conn);
} }
static bool cliHandleNoResp(SCliConn* conn) { static bool cliHandleNoResp(SCliConn* conn) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册