]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Disconnect P2P group on supplicant deinit
authorNirav Shah <nirav.j2.shah@intel.com>
Fri, 6 Apr 2012 15:41:06 +0000 (18:41 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 6 Apr 2012 15:41:06 +0000 (18:41 +0300)
When a supplicant is deinited and shutting, disconnect from P2P groups.
This fixes a memory leak on variable dbus_groupobj_path on exiting
supplicant.

Signed-hostap: Nirav Shah <nirav.j2.shah@intel.com>
Signed-hostap: Angie Chinchilla <angie.v.chinchilla@intel.com>

wpa_supplicant/p2p_supplicant.c

index 4b5c95de3f9ef327d269617dd026f234ae2ea800..1c339d2d6b152a211eb21f72d7875ad7b61f157b 100644 (file)
@@ -2479,7 +2479,6 @@ void wpas_p2p_deinit(struct wpa_supplicant *wpa_s)
 void wpas_p2p_deinit_global(struct wpa_global *global)
 {
        struct wpa_supplicant *wpa_s, *tmp;
-       char *ifname;
 
        if (global->p2p == NULL)
                return;
@@ -2500,12 +2499,9 @@ void wpas_p2p_deinit_global(struct wpa_global *global)
                }
                if (tmp == NULL)
                        break;
-               ifname = os_strdup(tmp->ifname);
                type = wpas_p2p_if_type(tmp->p2p_group_interface);
-               wpa_supplicant_remove_iface(global, tmp, 0);
-               if (ifname)
-                       wpa_drv_if_remove(wpa_s, type, ifname);
-               os_free(ifname);
+               /* Disconnect from the P2P group and deinit the interface */
+               wpas_p2p_disconnect(tmp);
        }
 
        /*