fix(tmq): memory leak in call back
This commit is contained in:
parent
6f75e03a55
commit
7fccac5029
|
@ -381,6 +381,9 @@ int32_t tmqCommitCb(void* param, SDataBuf* pBuf, int32_t code) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
taosMemoryFree(pParam->pOffset);
|
||||||
|
if (pBuf->pData) taosMemoryFree(pBuf->pData);
|
||||||
|
|
||||||
/*tscDebug("receive offset commit cb of %s on vgId:%d, offset is %" PRId64, pParam->pOffset->subKey, pParam->->vgId,
|
/*tscDebug("receive offset commit cb of %s on vgId:%d, offset is %" PRId64, pParam->pOffset->subKey, pParam->->vgId,
|
||||||
* pOffset->version);*/
|
* pOffset->version);*/
|
||||||
|
|
||||||
|
@ -388,8 +391,6 @@ int32_t tmqCommitCb(void* param, SDataBuf* pBuf, int32_t code) {
|
||||||
int32_t waitingRspNum = atomic_sub_fetch_32(&pParamSet->waitingRspNum, 1);
|
int32_t waitingRspNum = atomic_sub_fetch_32(&pParamSet->waitingRspNum, 1);
|
||||||
ASSERT(waitingRspNum >= 0);
|
ASSERT(waitingRspNum >= 0);
|
||||||
|
|
||||||
taosMemoryFree(pParam);
|
|
||||||
|
|
||||||
if (waitingRspNum == 0) {
|
if (waitingRspNum == 0) {
|
||||||
// if no more waiting rsp
|
// if no more waiting rsp
|
||||||
if (pParamSet->async) {
|
if (pParamSet->async) {
|
||||||
|
@ -1220,6 +1221,7 @@ END:
|
||||||
} else {
|
} else {
|
||||||
taosMemoryFree(pParam);
|
taosMemoryFree(pParam);
|
||||||
}
|
}
|
||||||
|
taosMemoryFree(pMsg->pData);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue