]> granicus.if.org Git - esp-idf/commitdiff
mdns: fix leak after _mdns_create_service if we have a malloc error.
authorQuentin Thérond <q.therond@overkiz.com>
Tue, 25 Jul 2017 12:14:35 +0000 (14:14 +0200)
committerAngus Gratton <gus@projectgus.com>
Wed, 30 Aug 2017 02:11:57 +0000 (12:11 +1000)
components/mdns/mdns.c

index 39cc0182918f9cc5dbae85e38ac2fed1a37cb86f..c3e5c49898be6e3817ea041dae463bd1db14b0d6 100644 (file)
@@ -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;
     }