mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
fixed memory leak
This commit is contained in:
parent
e0e50faa47
commit
5d0852c1e2
@ -277,6 +277,7 @@ namespace garlic
|
|||||||
{
|
{
|
||||||
newTags->msgID = msgID;
|
newTags->msgID = msgID;
|
||||||
m_UnconfirmedTagsMsgs.emplace_back (newTags);
|
m_UnconfirmedTagsMsgs.emplace_back (newTags);
|
||||||
|
newTags = nullptr; // got acquired
|
||||||
}
|
}
|
||||||
m_Owner->DeliveryStatusSent (shared_from_this (), msgID);
|
m_Owner->DeliveryStatusSent (shared_from_this (), msgID);
|
||||||
}
|
}
|
||||||
@ -300,13 +301,14 @@ namespace garlic
|
|||||||
size += CreateGarlicClove (payload + size, msg, m_Destination ? m_Destination->IsDestination () : false);
|
size += CreateGarlicClove (payload + size, msg, m_Destination ? m_Destination->IsDestination () : false);
|
||||||
(*numCloves)++;
|
(*numCloves)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset (payload + size, 0, 3); // certificate of message
|
memset (payload + size, 0, 3); // certificate of message
|
||||||
size += 3;
|
size += 3;
|
||||||
htobe32buf (payload + size, msgID); // MessageID
|
htobe32buf (payload + size, msgID); // MessageID
|
||||||
size += 4;
|
size += 4;
|
||||||
htobe64buf (payload + size, ts + 8000); // Expiration of message, 8 sec
|
htobe64buf (payload + size, ts + 8000); // Expiration of message, 8 sec
|
||||||
size += 8;
|
size += 8;
|
||||||
|
|
||||||
|
if (newTags) delete newTags; // not acquired, delete
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user