mirror of
https://github.com/taosdata/TDengine
synced 2026-05-24 10:09:01 +00:00
fix possible mem leak while driver quit (#33093)
This commit is contained in:
parent
2181b6e79b
commit
0f2f307d87
2 changed files with 13 additions and 1 deletions
|
|
@ -2396,15 +2396,26 @@ int32_t initCb(void* thrd, SCliReq* pReq, STransMsg* pResp) {
|
|||
}
|
||||
return cliMayCvtFqdnToIp(pReq->ctx->epSet, pThrd->pCvtAddr);
|
||||
}
|
||||
|
||||
static void freeUserCtx(SCliReq* pReq) {
|
||||
if (!pReq || !pReq->ctx) {
|
||||
return;
|
||||
}
|
||||
transCtxCleanup(&pReq->ctx->userCtx);
|
||||
}
|
||||
|
||||
int32_t notifyExceptCb(void* thrd, SCliReq* pReq, STransMsg* pResp) {
|
||||
SCliThrd* pThrd = thrd;
|
||||
STrans* pInst = pThrd->pInst;
|
||||
int32_t code = cliBuildExceptResp(pThrd, pReq, pResp);
|
||||
if (code != 0) {
|
||||
freeUserCtx(pReq);
|
||||
destroyReq(pReq);
|
||||
return code;
|
||||
}
|
||||
pInst->cfp(pInst->parent, pResp, NULL);
|
||||
|
||||
freeUserCtx(pReq);
|
||||
destroyReq(pReq);
|
||||
return code;
|
||||
}
|
||||
|
|
@ -4246,7 +4257,6 @@ int32_t transAllocHandle(int64_t* refId) {
|
|||
if (exh == NULL) {
|
||||
return terrno;
|
||||
}
|
||||
|
||||
exh->refId = transAddExHandle(transGetRefMgt(), exh);
|
||||
if (exh->refId < 0) {
|
||||
taosMemoryFree(exh);
|
||||
|
|
|
|||
|
|
@ -513,6 +513,8 @@ void transCtxMerge(STransCtx* dst, STransCtx* src) {
|
|||
}
|
||||
|
||||
taosHashCleanup(src->args);
|
||||
src->args = NULL;
|
||||
src->brokenVal.val = NULL;
|
||||
}
|
||||
void* transCtxDumpVal(STransCtx* ctx, int32_t key) {
|
||||
if (ctx->args == NULL) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue