From 969e9f2e907ba34e2e5f064941fccc24d19dc855 Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Tue, 1 Mar 2016 18:33:11 +1100 Subject: [PATCH] Fix fatal crash if enduser_setup.stop() called twice. --- app/modules/enduser_setup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/modules/enduser_setup.c b/app/modules/enduser_setup.c index fb91448a..e043a70d 100644 --- a/app/modules/enduser_setup.c +++ b/app/modules/enduser_setup.c @@ -332,7 +332,8 @@ static void enduser_setup_check_station_stop(void) { ENDUSER_SETUP_DEBUG(lua_getstate(), "enduser_setup_check_station_stop"); - os_timer_disarm(&(state->check_station_timer)); + if (state != NULL) + os_timer_disarm(&(state->check_station_timer)); } @@ -1197,7 +1198,7 @@ static void enduser_setup_dns_stop(void) { ENDUSER_SETUP_DEBUG(lua_getstate(), "enduser_setup_dns_stop"); - if (state->espconn_dns_udp != NULL) + if (state != NULL && state->espconn_dns_udp != NULL) { espconn_delete(state->espconn_dns_udp); }