Add null check for packet allocation and clean up Dispatcher

This commit is contained in:
João Brázio committed 2025-07-08 16:02:10 +01:00
1 parent 30de4db0a4
commit f36fb64f65
2 files changed
+14 -8

No files matched your search

+10 -3
View File
@@ -774,9 +774,16 @@ public:
#endif
if (f16 == crc) {
mesh::Packet *pkt = _mgr->allocNew();
pkt->readFrom(bytes, len);
_mgr->queueInbound(pkt, millis());
Packet *pkt = _mgr->allocNew();
if (pkt != NULL) {
pkt->readFrom(bytes, len);
_mgr->queueInbound(pkt, millis());
} else {
#if MESH_PACKET_LOGGING
Serial.printf("BRIDGE: Unable to allocate new Packet *pkt");
#endif
}
}
}
}