fix: fix asan issues
This commit is contained in:
parent
fb861a3935
commit
448fee1744
|
@ -3186,6 +3186,14 @@ typedef struct {
|
||||||
|
|
||||||
int32_t tSerializeSBatchReq(void *buf, int32_t bufLen, SBatchReq *pReq);
|
int32_t tSerializeSBatchReq(void *buf, int32_t bufLen, SBatchReq *pReq);
|
||||||
int32_t tDeserializeSBatchReq(void *buf, int32_t bufLen, SBatchReq *pReq);
|
int32_t tDeserializeSBatchReq(void *buf, int32_t bufLen, SBatchReq *pReq);
|
||||||
|
static FORCE_INLINE void tFreeSBatchReqMsg(void* msg) {
|
||||||
|
if (NULL == msg) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SBatchMsg* pMsg = (SBatchMsg*)msg;
|
||||||
|
taosMemoryFree(pMsg->msg);
|
||||||
|
}
|
||||||
|
|
||||||
int32_t tSerializeSBatchRsp(void *buf, int32_t bufLen, SBatchRsp *pRsp);
|
int32_t tSerializeSBatchRsp(void *buf, int32_t bufLen, SBatchRsp *pRsp);
|
||||||
int32_t tDeserializeSBatchRsp(void *buf, int32_t bufLen, SBatchRsp *pRsp);
|
int32_t tDeserializeSBatchRsp(void *buf, int32_t bufLen, SBatchRsp *pRsp);
|
||||||
|
|
||||||
|
|
|
@ -4510,7 +4510,7 @@ int32_t tDeserializeSBatchReq(void *buf, int32_t bufLen, SBatchReq *pReq) {
|
||||||
if (tDecodeI32(&decoder, &msg.msgIdx) < 0) return -1;
|
if (tDecodeI32(&decoder, &msg.msgIdx) < 0) return -1;
|
||||||
if (tDecodeI32(&decoder, &msg.msgType) < 0) return -1;
|
if (tDecodeI32(&decoder, &msg.msgType) < 0) return -1;
|
||||||
if (tDecodeI32(&decoder, &msg.msgLen) < 0) return -1;
|
if (tDecodeI32(&decoder, &msg.msgLen) < 0) return -1;
|
||||||
if (tDecodeBinary(&decoder, (uint8_t**)&msg.msg, NULL) < 0) return -1;
|
if (tDecodeBinaryAlloc(&decoder, &msg.msg, NULL) < 0) return -1;
|
||||||
if (NULL == taosArrayPush(pReq->pMsgs, &msg)) return -1;
|
if (NULL == taosArrayPush(pReq->pMsgs, &msg)) return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,6 +157,7 @@ _exit:
|
||||||
mError("mnd get batch meta failed cause of %s", tstrerror(code));
|
mError("mnd get batch meta failed cause of %s", tstrerror(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taosArrayDestroyEx(batchReq.pMsgs, tFreeSBatchReqMsg);
|
||||||
taosArrayDestroyEx(batchRsp.pRsps, mnodeFreeSBatchRspMsg);
|
taosArrayDestroyEx(batchRsp.pRsps, mnodeFreeSBatchRspMsg);
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
|
|
@ -366,6 +366,7 @@ _exit:
|
||||||
qError("vnd get batch meta failed cause of %s", tstrerror(code));
|
qError("vnd get batch meta failed cause of %s", tstrerror(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taosArrayDestroyEx(batchReq.pMsgs, tFreeSBatchReqMsg);
|
||||||
taosArrayDestroyEx(batchRsp.pRsps, tFreeSBatchRspMsg);
|
taosArrayDestroyEx(batchRsp.pRsps, tFreeSBatchRspMsg);
|
||||||
|
|
||||||
tmsgSendRsp(&rspMsg);
|
tmsgSendRsp(&rspMsg);
|
||||||
|
|
Loading…
Reference in New Issue