mdns: fix possible crash when mdns_free called while action queue not empty

This commit is contained in:
David Cermak 2019-02-15 13:23:21 +01:00
parent 9a4da97fb4
commit 206b47c03a

View file

@ -4017,8 +4017,6 @@ static esp_err_t _mdns_service_task_stop()
MDNS_SERVICE_LOCK();
_mdns_stop_timer();
MDNS_SERVICE_UNLOCK();
vSemaphoreDelete(_mdns_service_semaphore);
_mdns_service_semaphore = NULL;
if (_mdns_service_task_handle) {
mdns_action_t action;
mdns_action_t * a = &action;
@ -4031,6 +4029,8 @@ static esp_err_t _mdns_service_task_stop()
vTaskDelay(10 / portTICK_PERIOD_MS);
}
}
vSemaphoreDelete(_mdns_service_semaphore);
_mdns_service_semaphore = NULL;
return ESP_OK;
}