Merge branch 'bugfix/mdns_crash_on_network_change_backport3.0' into 'release/v3.0'

mdns: fixed crashes on network changes (backport v3.0)

See merge request idf/esp-idf!3785
This commit is contained in:
Ivan Grokhotkov 2018-12-21 11:59:20 +08:00
commit 9aff9f3f8b

View file

@ -3925,13 +3925,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) {