fix invalid free

This commit is contained in:
yihaoDeng 2024-11-26 19:45:00 +08:00
parent 2e56479f8a
commit 3843fa6de8
2 changed files with 6 additions and 4 deletions

View File

@ -2498,10 +2498,6 @@ static int32_t createThrdObj(void* trans, SCliThrd** ppThrd) {
_end:
if (pThrd) {
TAOS_UNUSED(taosThreadMutexDestroy(&pThrd->msgMtx));
TAOS_UNUSED(uv_loop_close(pThrd->loop));
taosMemoryFree(pThrd->loop);
TAOS_UNUSED((taosThreadMutexDestroy(&pThrd->msgMtx)));
transAsyncPoolDestroy(pThrd->asyncPool);
for (int i = 0; i < taosArrayGetSize(pThrd->timerList); i++) {
uv_timer_t* timer = taosArrayGetP(pThrd->timerList, i);
@ -2511,6 +2507,9 @@ _end:
taosArrayDestroy(pThrd->timerList);
TAOS_UNUSED(destroyConnPool(pThrd));
TAOS_UNUSED(uv_loop_close(pThrd->loop));
taosMemoryFree(pThrd->loop);
transDQDestroy(pThrd->delayQueue, NULL);
transDQDestroy(pThrd->timeoutQueue, NULL);
transDQDestroy(pThrd->waitConnQueue, NULL);

View File

@ -1379,6 +1379,9 @@ _end:
pConn = NULL;
}
tError("%s failed to create conn since %s", transLabel(pInst), tstrerror(code));
return NULL;
_end2:
return NULL;
}