From a2c9d19147c40942ccf96da57e36a68695f0761d Mon Sep 17 00:00:00 2001 From: Bartosz Nitka Date: Mon, 26 May 2025 17:35:45 +0200 Subject: [PATCH] Fix a memory leak in http_fns.c (#1653) --- src/httpserver/http_fns.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/httpserver/http_fns.c b/src/httpserver/http_fns.c index 2ee960671..011209d30 100644 --- a/src/httpserver/http_fns.c +++ b/src/httpserver/http_fns.c @@ -2227,6 +2227,7 @@ void doHomeAssistantDiscovery(const char* topic, http_request_t* request) { #ifndef NO_CHIP_TEMPERATURE dev_info = hass_init_sensor_device_info(HASS_TEMP, -1, -1, -1, 1); MQTT_QueuePublish(topic, dev_info->channel, hass_build_discovery_json(dev_info), OBK_PUBLISH_FLAG_RETAIN); + hass_free_device_info(dev_info); #endif dev_info = hass_init_sensor_device_info(HASS_RSSI, -1, -1, -1, 1); MQTT_QueuePublish(topic, dev_info->channel, hass_build_discovery_json(dev_info), OBK_PUBLISH_FLAG_RETAIN);