Skip to content

Commit

Permalink
Fix possible memory leak for ROUTER_LATE (#5901)
Browse files Browse the repository at this point in the history
  • Loading branch information
GUVWAF authored Jan 21, 2025
1 parent c4fcbad commit f87c370
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mesh/RadioLibInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,11 @@ void RadioLibInterface::clampToLateRebroadcastWindow(NodeNum from, PacketId id)
meshtastic_MeshPacket *p = txQueue.remove(from, id, true, false);
if (p) {
p->tx_after = millis() + getTxDelayMsecWeightedWorst(p->rx_snr);
txQueue.enqueue(p);
LOG_DEBUG("Move existing queued packet to the late rebroadcast window %dms from now", p->tx_after - millis());
if (txQueue.enqueue(p)) {
LOG_DEBUG("Move existing queued packet to the late rebroadcast window %dms from now", p->tx_after - millis());
} else {
packetPool.release(p);
}
}
}

Expand Down

0 comments on commit f87c370

Please sign in to comment.