]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
D-Bus: Fix P2P persistent group removal from non-D-Bus triggers
authorJouni Malinen <j@w1.fi>
Sat, 27 Dec 2014 19:00:11 +0000 (21:00 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 29 Dec 2014 13:49:05 +0000 (15:49 +0200)
It is possible for the persistent group object to be added and removed
by non-D-Bus triggers (e.g., ctrl_iface commands). The add part was
already handled, but removal was not. That resulted in memory leaks when
a P2P persistent group was removed without using an explicit D-Bus
command for this even if the object was added without D-Bus involvement.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/notify.c

index de33019ea2589011ecb5a6719ee8add5153f5b9c..df1ce9e0ccb9a8a5e71738f24a1c4d6572ade467 100644 (file)
@@ -316,6 +316,9 @@ void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
                wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid);
        if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s)
                wpas_dbus_unregister_network(wpa_s, ssid->id);
+       if (network_is_persistent_group(ssid))
+               wpas_notify_persistent_group_removed(wpa_s, ssid);
+
        wpas_p2p_network_removed(wpa_s, ssid);
 }