mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Add null check for packet allocation and clean up Dispatcher
This commit is contained in:
parent
ac056fb0b9
commit
92ee1820c4
2 changed files with 14 additions and 8 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue