From ec1a3b0021436e4848b983f11a47106b230acd23 Mon Sep 17 00:00:00 2001 From: Wu Jiangbo Date: Tue, 5 Nov 2013 14:24:58 +0800 Subject: [PATCH] Bug fixing: net-config crash after system reboot Root cause: When device powers off, g_slist_free_full() uses a NULL pointer as destroy function, which leads to net-config crash. Solution: Use function g_slist_free() to replace g_slist_free_full() to free the list when net-config exits. Change-Id: Ia9d5d6920b537fe8337a319fbd048167d244284e --- src/wifi-state.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wifi-state.c b/src/wifi-state.c index c445f3d..f4bc103 100644 --- a/src/wifi-state.c +++ b/src/wifi-state.c @@ -440,7 +440,13 @@ void netconfig_wifi_check_network_notification(DBusMessage *message) void netconfig_wifi_state_notifier_cleanup(void) { - g_slist_free_full(notifier_list, NULL); + /* + * Now, all the user_data of notifier_list's element + * is NULL, so we don't free that, only use g_slist_free. + * If user_data is not NULL, using g_slist_free_full with + * destory_notify function to free user_data + */ + g_slist_free(notifier_list); } void netconfig_wifi_state_notifier_register( -- 2.34.1