From ab9253abde7350ba504fa5a21a38ee7aa7ccc5c2 Mon Sep 17 00:00:00 2001 From: Tobias Blum Date: Sat, 19 Aug 2017 21:29:27 +0200 Subject: [PATCH] Issue: Memory leak in MQTT callback function #32 https://github.com/toblum/McLighting/issues/32 added free() --- Arduino/McLighting/request_handlers.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Arduino/McLighting/request_handlers.h b/Arduino/McLighting/request_handlers.h index eb399ab..89c9fe8 100644 --- a/Arduino/McLighting/request_handlers.h +++ b/Arduino/McLighting/request_handlers.h @@ -384,6 +384,8 @@ void checkForRequests() { DBG_OUTPUT_PORT.printf("MQTT: Set WS2812 mode [%s]\n", payload); mqtt_client.publish(mqtt_outtopic, String(String("OK ") + String((char *)payload)).c_str()); } + + free(payload); } void mqtt_reconnect() {