NULL, /* GDBusAuthObserver */
NULL,
&error);
+ g_free(address);
if (!private_gconn) {
if (error) {
BT_ERR("Unable to connect to dbus: %s", error->message);
proxy = g_dbus_proxy_new_sync(gconn, G_DBUS_PROXY_FLAGS_NONE, NULL,
BT_BLUEZ_NAME, object_path, BT_PROPERTIES_INTERFACE, NULL,
&err);
-
g_free(object_path);
-
- retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
- if (err) {
- BT_ERR("DBus Error: [%s]", err->message);
- g_clear_error(&err);
+ if (proxy == NULL) {
+ if (err) {
+ BT_ERR("DBus Error: [%s]", err->message);
+ g_clear_error(&err);
+ }
+ return BLUETOOTH_ERROR_INTERNAL;
}
ret = g_dbus_proxy_call_sync(proxy, "Get",
g_variant_new("(ss)", BT_DEVICE_INTERFACE, "UUIDs"),
GVariant *value = NULL;
GVariant *result = NULL;
unsigned int class = 0x00;
- int ret = BLUETOOTH_ERROR_INTERNAL;
+ int ret = BLUETOOTH_ERROR_NONE;
gconn = __get_gdbus_connection();
retv_if(gconn == NULL, BLUETOOTH_ERROR_INTERNAL);
- object_path = _bt_get_device_object_path(address);
+ object_path = _bt_get_device_object_path(address);
retv_if(object_path == NULL, BLUETOOTH_ERROR_INTERNAL);
proxy = g_dbus_proxy_new_sync(gconn, G_DBUS_PROXY_FLAGS_NONE, NULL,
BT_BLUEZ_NAME, object_path, BT_PROPERTIES_INTERFACE, NULL,
&err);
-
- g_free(object_path);
-
- retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
- if (err) {
- BT_ERR("DBus Error: [%s]", err->message);
- g_clear_error(&err);
+ if (proxy == NULL) {
+ ret = BLUETOOTH_ERROR_INTERNAL;
+ if (err) {
+ BT_ERR("DBus Error: [%s]", err->message);
+ g_clear_error(&err);
+ }
+ goto done;
}
result = g_dbus_proxy_call_sync(proxy, "Get",
}
done:
+ g_free(object_path);
if (proxy)
g_object_unref(proxy);