mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-23 23:37:31 +02:00
mdns: fix leak after _mdns_create_service if we have a malloc error.
* Original commit: espressif/esp-idf@b6b36bd9dd
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
b367484361
commit
907e7ee29e
@ -1755,6 +1755,7 @@ esp_err_t mdns_service_add(mdns_server_t * server, const char * service, const c
|
||||
|
||||
item = (mdns_srv_item_t *)malloc(sizeof(mdns_srv_item_t));
|
||||
if (!item) {
|
||||
free(s);
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user