esp_event: fix minor memory leak when overwriting alredy registered handler

This commit is contained in:
David Cermak 2019-05-30 16:59:24 +02:00
parent a38b50a8a9
commit 37c91133ff

View File

@ -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;