fix: fix msg head issue
This commit is contained in:
parent
9ce099a2cf
commit
65636154ea
|
@ -466,7 +466,7 @@ static void *mndBuildVCreateStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pSt
|
|||
|
||||
contLen += sizeof(SMsgHead);
|
||||
|
||||
SMsgHead *pHead = taosMemoryMalloc(contLen);
|
||||
SMsgHead *pHead = taosMemoryCalloc(1, contLen);
|
||||
if (pHead == NULL) {
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto _err;
|
||||
|
@ -519,6 +519,7 @@ static void *mndBuildVDropStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb,
|
|||
|
||||
pHead->contLen = htonl(contLen);
|
||||
pHead->vgId = htonl(pVgroup->vgId);
|
||||
pHead->msgMask = htonl(0);
|
||||
|
||||
void *pBuf = POINTER_SHIFT(pHead, sizeof(SMsgHead));
|
||||
|
||||
|
@ -2596,4 +2597,4 @@ const char *mndGetStbStr(const char *src) {
|
|||
if (posStb != NULL) ++posStb;
|
||||
if (posStb == NULL) return posDb;
|
||||
return posStb;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ SSyncRaftEntry* syncEntryBuildNoop(SyncTerm term, SyncIndex index, int32_t vgId)
|
|||
SMsgHead head;
|
||||
head.vgId = vgId;
|
||||
head.contLen = sizeof(SMsgHead);
|
||||
head.msgMask = 0;
|
||||
SRpcMsg rpcMsg;
|
||||
memset(&rpcMsg, 0, sizeof(SRpcMsg));
|
||||
rpcMsg.contLen = head.contLen;
|
||||
|
|
Loading…
Reference in New Issue