Fix another heap leak (#5328)

This commit is contained in:
GUVWAF
2024-11-12 10:59:29 -06:00
committed by GitHub
parent a49f080bd2
commit f4b0e19a65
+2 -2
View File
@@ -176,9 +176,9 @@ bool ReliableRouter::stopRetransmission(GlobalPacketId key)
if (old->numRetransmissions < NUM_RETRANSMISSIONS - 1) { if (old->numRetransmissions < NUM_RETRANSMISSIONS - 1) {
// remove the 'original' (identified by originator and packet->id) from the txqueue and free it // remove the 'original' (identified by originator and packet->id) from the txqueue and free it
cancelSending(getFrom(p), p->id); cancelSending(getFrom(p), p->id);
// now free the pooled copy for retransmission too
packetPool.release(p);
} }
// now free the pooled copy for retransmission too
packetPool.release(p);
auto numErased = pending.erase(key); auto numErased = pending.erase(key);
assert(numErased == 1); assert(numErased == 1);
return true; return true;