Merge pull request #23106 from taosdata/fix/fixTransInvalidReadMain

fix trans invalid read
This commit is contained in:
Haojun Liao 2023-09-28 09:15:12 +08:00 committed by GitHub
commit 9df5217221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -576,6 +576,7 @@ void* destroyConnPool(SCliThrd* pThrd) {
connList = taosHashIterate((SHashObj*)pool, connList); connList = taosHashIterate((SHashObj*)pool, connList);
} }
taosHashCleanup(pool); taosHashCleanup(pool);
pThrd->pool = NULL;
return NULL; return NULL;
} }
@ -870,9 +871,11 @@ static void cliDestroyConn(SCliConn* conn, bool clear) {
connList->list->numOfConn--; connList->list->numOfConn--;
connList->size--; connList->size--;
} else { } else {
if (pThrd->pool) {
SConnList* connList = taosHashGet((SHashObj*)pThrd->pool, conn->dstAddr, strlen(conn->dstAddr) + 1); SConnList* connList = taosHashGet((SHashObj*)pThrd->pool, conn->dstAddr, strlen(conn->dstAddr) + 1);
if (connList != NULL) connList->list->numOfConn--; if (connList != NULL) connList->list->numOfConn--;
} }
}
conn->list = NULL; conn->list = NULL;
pThrd->newConnCount--; pThrd->newConnCount--;