fix mem leak

This commit is contained in:
Liu Jicong 2022-01-18 16:15:24 +08:00
parent ddf7dcc94f
commit d14a599a32
1 changed files with 3 additions and 5 deletions

View File

@ -357,15 +357,13 @@ static int32_t mndProcessHeartBeatReq(SMnodeMsg *pReq) {
} }
} }
} }
for (int i = 0; i < sz; i++) { taosArrayDestroyEx(pArray, tFreeClientHbReq);
SClientHbReq* pHbReq = taosArrayGet(pArray, i);
tFreeClientHbReq(pHbReq);
}
taosArrayDestroy(pArray);
int32_t tlen = tSerializeSClientHbBatchRsp(NULL, &batchRsp); int32_t tlen = tSerializeSClientHbBatchRsp(NULL, &batchRsp);
void* buf = rpcMallocCont(tlen); void* buf = rpcMallocCont(tlen);
void* abuf = buf; void* abuf = buf;
tSerializeSClientHbBatchRsp(&abuf, &batchRsp); tSerializeSClientHbBatchRsp(&abuf, &batchRsp);
taosArrayDestroy(batchRsp.rsps);
pReq->contLen = tlen; pReq->contLen = tlen;
pReq->pCont = buf; pReq->pCont = buf;
return 0; return 0;