Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory leaks by adding missing
free()
calls before early return…
…s 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.
- Loading branch information