wifi: robustify supplicant info destruction
authorDan Williams <dcbw@redhat.com>
Wed, 14 Apr 2010 22:22:48 +0000 (15:22 -0700)
committerDan Williams <dcbw@redhat.com>
Wed, 14 Apr 2010 22:22:48 +0000 (15:22 -0700)
Zero out the struct so we crash if we ever try to use it after its
been freed.

src/supplicant-manager/nm-supplicant-interface.c

index b91a509..a65a458 100644 (file)
@@ -188,12 +188,17 @@ nm_supplicant_info_destroy (gpointer user_data)
        if (!info->disposing) {
                info->disposing = TRUE;
 
-               if (info->call)
+               if (info->call) {
                        nm_call_store_remove (info->store, G_OBJECT (info->proxy), info->call);
+                       info->call = NULL;
+               }
 
                g_object_unref (info->proxy);
+               info->proxy = NULL;
                g_object_unref (info->interface);
+               info->interface = NULL;
 
+               memset (info, 0, sizeof (NMSupplicantInfo));
                g_slice_free (NMSupplicantInfo, info);
        }
 }