mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +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));
|
item = (mdns_srv_item_t *)malloc(sizeof(mdns_srv_item_t));
|
||||||
if (!item) {
|
if (!item) {
|
||||||
|
free(s);
|
||||||
return ESP_ERR_NO_MEM;
|
return ESP_ERR_NO_MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user