From 6a6fccc1918f14fd807a5b7c432f557c409debc1 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 22 Oct 2018 16:45:42 +0200 Subject: [PATCH] mdns: fixed crashes on network change (not properly locked sending packets to queue from timer task), backport 3.1 --- components/mdns/mdns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index 43c3240f92..31fb592f29 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -3779,13 +3779,14 @@ static esp_err_t _mdns_send_search_action(mdns_action_type_t type, mdns_search_o */ static void _mdns_scheduler_run() { + MDNS_SERVICE_LOCK(); mdns_tx_packet_t * p = _mdns_server->tx_queue_head; mdns_action_t * action = NULL; if (!p) { + MDNS_SERVICE_UNLOCK(); return; } - MDNS_SERVICE_LOCK(); if ((int32_t)(p->send_at - (xTaskGetTickCount() * portTICK_PERIOD_MS)) < 0) { action = (mdns_action_t *)malloc(sizeof(mdns_action_t)); if (action) {