Bug fixing: net-config crash after system reboot 49/14549/1
authorWu Jiangbo <jiangbox.wu@intel.com>
Tue, 5 Nov 2013 06:24:58 +0000 (14:24 +0800)
committerZhang zhengguang <zhengguang.zhang@intel.com>
Tue, 7 Jan 2014 08:43:02 +0000 (16:43 +0800)
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

index c445f3d83dce6dda9456443477abbdbfe77f7ecd..f4bc1038bec4f6859737dce9a13a355f0d97e6ef 100644 (file)
@@ -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(