Check if there's something there before we free it

This commit is contained in:
Thomas Göttgens
2023-02-21 20:01:56 +01:00
committed by GitHub
co-authored by GitHub
parent 2e80a4ed87
commit d830398fc5
+1
View File
@@ -151,6 +151,7 @@ bool ReliableRouter::stopRetransmission(GlobalPacketId key)
// 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(old->packet), old->packet->id); cancelSending(getFrom(old->packet), old->packet->id);
// now free the pooled copy for retransmission too. tryfix for #2228 // now free the pooled copy for retransmission too. tryfix for #2228
if (old->packet)
packetPool.release(old->packet); packetPool.release(old->packet);
return true; return true;
} else } else