D-Bus (old): Fix interface unregistration on error path
authorJouni Malinen <j@w1.fi>
Tue, 6 Jan 2015 21:07:12 +0000 (23:07 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 7 Jan 2015 11:19:01 +0000 (13:19 +0200)
It is possible for this function to be called even if D-Bus interface
registration has failed. Avoid a D-Bus assert in such a case.

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

index 1c85686..45bb402 100644 (file)
@@ -712,7 +712,7 @@ int wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s)
        if (wpa_s == NULL || wpa_s->global == NULL)
                return 0;
        ctrl_iface = wpa_s->global->dbus;
-       if (ctrl_iface == NULL)
+       if (ctrl_iface == NULL || wpa_s->dbus_path == NULL)
                return 0;
 
        con = ctrl_iface->con;