fix invalid free

This commit is contained in:
yihaoDeng 2024-03-12 03:08:20 +00:00
parent 26ea125f03
commit 31b6d15240
1 changed files with 4 additions and 1 deletions

View File

@ -892,11 +892,14 @@ int32_t schCloneCallbackParam(SSchCallbackParamHeader *pSrc, SSchCallbackParamHe
int32_t schCloneSMsgSendInfo(void *src, void **dst) {
SMsgSendInfo *pSrc = src;
int32_t code = 0;
SMsgSendInfo *pDst = taosMemoryMalloc(sizeof(*pSrc));
SMsgSendInfo *pDst = taosMemoryCalloc(1, sizeof(*pSrc));
if (NULL == pDst) {
qError("malloc SMsgSendInfo for rpcCtx failed, len:%d", (int32_t)sizeof(*pSrc));
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
}
if (pDst->target.dbFName != NULL) {
pDst->target.dbFName = taosStrdup(pSrc->target.dbFName);
}
memcpy(pDst, pSrc, sizeof(*pSrc));
pDst->param = NULL;