mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-29 06:00:33 +00:00
37da78919a679a632eea29f4b3d6d1a4cbbd84fb
free() calls before early returns in MQTT::onReceive (#5439)
This fix addresses memory leaks in the `MQTT::onReceive` function by ensuring that dynamically allocated resources (`e.channel_id`, `e.gateway_id` and `e.packet`) are properly freed before each early return. Previously, these resources were only freed at the end of the function, leaving them unhandled in certain exit paths. Adding the missing `free()` calls prevents memory leaks and ensures proper resource cleanup in all scenarios.
Meshtastic Firmware
Overview
This repository contains the device firmware for the Meshtastic project.
Stats
Languages
C++
67.2%
C
30.9%
Python
1.1%
Shell
0.3%
Batchfile
0.3%
Other
0.1%