if (dbus_set_error_from_message(&error, reply) == TRUE) {
connman_error("%s", error.message);
dbus_error_free(&error);
- goto done;
+
+ goto err;
}
if (dbus_message_get_args(reply, &error,
dbus_error_free(&error);
} else
connman_error("Wrong arguments for connect");
- goto done;
+ goto err;
}
if (interface == NULL)
- goto done;
+ goto err;
DBG("interface %s", interface);
connman_network_set_connected(network, TRUE);
-done:
+ dbus_message_unref(reply);
+
+ dbus_pending_call_unref(call);
+
+ return;
+err:
+
+ connman_network_set_connected(network, FALSE);
+
dbus_message_unref(reply);
dbus_pending_call_unref(call);