From f7fd058308112ff842f4661807cfb61c70809cfc Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Jul 2026 08:22:42 -0500 Subject: [PATCH] Fix packet-pool slot leak in canned message destination picker (#11017) updateDestinationSelectionList() allocated a MeshPacket via allocDataPacket() that was never sent or released, permanently consuming one packetPool slot every time the destination-selection picker was rebuilt. On non-PSRAM targets packetPool is a static 70-slot BSS pool, so repeated picker use exhausts it and eventually blocks all packet allocation (TX/RX failures). On PSRAM/portduino (MemoryDynamic) targets it is a true heap leak of ~424B per rebuild. The allocation and its two field writes (pki_encrypted, channel) were a copy/paste artifact of the PKI setup in sendText() and had no effect in this function. Remove the dead allocation. --- src/modules/CannedMessageModule.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 7d3116127..771066054 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -289,10 +289,6 @@ void CannedMessageModule::updateDestinationSelectionList() } } - meshtastic_MeshPacket *p = allocDataPacket(); - p->pki_encrypted = true; - p->channel = 0; - // Populate active channels std::vector seenChannels; seenChannels.reserve(channels.getNumChannels());