mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
esp_event: fix minor memory leak when overwriting alredy registered handler
This commit is contained in:
@@ -180,6 +180,7 @@ static esp_err_t handler_instances_add(esp_event_handler_instances_t* handlers,
|
|||||||
if (handler == it->handler) {
|
if (handler == it->handler) {
|
||||||
it->arg = handler_arg;
|
it->arg = handler_arg;
|
||||||
ESP_LOGW(TAG, "handler already registered, overwriting");
|
ESP_LOGW(TAG, "handler already registered, overwriting");
|
||||||
|
free(handler_instance);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
last = it;
|
last = it;
|
||||||
|
Reference in New Issue
Block a user