From ce8b52617e22fc5f811e251cdc1ab75ce6b44220 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Wed, 7 Dec 2016 14:31:54 +0000 Subject: [PATCH] Zero-fill netif on alloc Fixes espressif/esp-idf#133 --- components/tcpip_adapter/tcpip_adapter_lwip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tcpip_adapter/tcpip_adapter_lwip.c b/components/tcpip_adapter/tcpip_adapter_lwip.c index 222e8017eb..c20fea5059 100644 --- a/components/tcpip_adapter/tcpip_adapter_lwip.c +++ b/components/tcpip_adapter/tcpip_adapter_lwip.c @@ -64,7 +64,7 @@ esp_err_t tcpip_adapter_start(tcpip_adapter_if_t tcpip_if, uint8_t *mac, tcpip_a } if (esp_netif[tcpip_if] == NULL) { - esp_netif[tcpip_if] = malloc(sizeof(struct netif)); + esp_netif[tcpip_if] = calloc(1, sizeof(*esp_netif[tcpip_if])); if (esp_netif[tcpip_if] == NULL) { return ESP_ERR_NO_MEM; } -- 2.40.0