As the callback for the call accesses GSupplicantInterface structure,
tie the pending call to the interface pointer so that it gets cancelled
if the interface is removed.
---
 gsupplicant/supplicant.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 2674298..0b42ce8 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1964,7 +1964,7 @@ static void interface_added(DBusMessageIter *iter, void 
*user_data)
 
        supplicant_dbus_method_call(path,
                        SUPPLICANT_INTERFACE ".Interface.P2PDevice", "Flush",
-                       NULL, interface_p2p_flush, interface, NULL);
+                       NULL, interface_p2p_flush, interface, interface);
 
        dbus_message_iter_next(iter);
        if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INVALID) {
-- 
1.8.5.3

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to