From 9b4c260a92fba177896bb3ea53b1b2f001a023c6 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Mon, 11 Nov 2024 13:22:22 +0100 Subject: [PATCH] Fix memory leak in MQTT (#5311) --- src/mqtt/MQTT.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 76607f6d27..0e2710940f 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -580,6 +580,7 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp_encrypted, const meshtastic_Me LOG_DEBUG("portnum %i message", env->packet->decoded.portnum); } else { LOG_DEBUG("nothing, pkt not decrypted"); + mqttPool.release(env); return; // Don't upload a still-encrypted PKI packet if not encryption_enabled } @@ -768,4 +769,4 @@ bool MQTT::isPrivateIpAddress(const char address[]) int octet2Num = atoi(octet2); return octet2Num >= 16 && octet2Num <= 31; -} +} \ No newline at end of file