mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_event: fix minor memory leak when overwriting alredy registered handler
This commit is contained in:
parent
a38b50a8a9
commit
37c91133ff
@ -180,6 +180,7 @@ static esp_err_t handler_instances_add(esp_event_handler_instances_t* handlers,
|
||||
if (handler == it->handler) {
|
||||
it->arg = handler_arg;
|
||||
ESP_LOGW(TAG, "handler already registered, overwriting");
|
||||
free(handler_instance);
|
||||
return ESP_OK;
|
||||
}
|
||||
last = it;
|
||||
|
Loading…
Reference in New Issue
Block a user