mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-29 18:27:20 +02:00
mdns: fix leak after _mdns_create_service if we have a malloc error.
This commit is contained in:
committed by
Angus Gratton
parent
88e71a680e
commit
b6b36bd9dd
@ -1689,6 +1689,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