fix(sync): fix memory leak
This commit is contained in:
parent
76628a52e6
commit
d381b4da93
|
@ -72,7 +72,7 @@ int32_t syncNodeReplicateOne(SSyncNode* pSyncNode, SRaftId* pDestId, bool snapsh
|
||||||
SRpcMsg rpcMsg = {0};
|
SRpcMsg rpcMsg = {0};
|
||||||
SyncAppendEntries* pMsg = NULL;
|
SyncAppendEntries* pMsg = NULL;
|
||||||
|
|
||||||
SSyncRaftEntry* pEntry;
|
SSyncRaftEntry* pEntry = NULL;
|
||||||
int32_t code = pSyncNode->pLogStore->syncLogGetEntry(pSyncNode->pLogStore, nextIndex, &pEntry);
|
int32_t code = pSyncNode->pLogStore->syncLogGetEntry(pSyncNode->pLogStore, nextIndex, &pEntry);
|
||||||
|
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
|
@ -99,6 +99,8 @@ int32_t syncNodeReplicateOne(SSyncNode* pSyncNode, SRaftId* pDestId, bool snapsh
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
syncEntryDestory(pEntry);
|
||||||
|
|
||||||
// prepare msg
|
// prepare msg
|
||||||
ASSERT(pMsg != NULL);
|
ASSERT(pMsg != NULL);
|
||||||
pMsg->srcId = pSyncNode->myRaftId;
|
pMsg->srcId = pSyncNode->myRaftId;
|
||||||
|
|
Loading…
Reference in New Issue