g_variant_get(tmp_value, "s", &address);
g_variant_unref(tmp_value);
- dev_info->address = g_strdup(address);
- dev_info->name = g_strdup(name);
- g_free(name);
+ dev_info->address = address;
+ dev_info->name = name;
g_variant_unref(value);
} else {
BT_ERR("result is NULL\n");
retv_if(device_path == NULL, BLUETOOTH_ERROR_NOT_PAIRED);
device_proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
- NULL, BT_BLUEZ_NAME,
- device_path, BT_DEVICE_INTERFACE, NULL, NULL);
+ NULL, BT_BLUEZ_NAME,
+ device_path, BT_DEVICE_INTERFACE, NULL, NULL);
g_free(device_path);
if (!device_proxy) {
BT_ERR("Unable to get proxy");
return BLUETOOTH_ERROR_INTERNAL;
}
- result = g_dbus_proxy_call_sync(device_proxy, "GetIDAddress",
- NULL,
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- NULL,
- &error);
-
+ result = g_dbus_proxy_call_sync(device_proxy, "GetIDAddress", NULL,
+ G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
if (result == NULL) {
BT_ERR("Failed to get device ID address");
if (error != NULL) {
return BLUETOOTH_ERROR_INTERNAL;
}
- g_variant_get(result , "(s)", &idaddress);
- g_variant_unref(result);
-
+ g_variant_get(result , "(&s)", &idaddress);
if (idaddress == NULL) {
BT_ERR("No paired device");
- g_object_unref(device_proxy);
- return BLUETOOTH_ERROR_NOT_PAIRED;
- }
-
- BT_DBG("ID Address:%s", idaddress);
-
- if (idaddress)
+ ret = BLUETOOTH_ERROR_NOT_PAIRED;
+ } else {
+ DBG_SECURE("ID Address : %s", idaddress);
_bt_convert_addr_string_to_type(id_address->addr, idaddress);
- else
- ret = BLUETOOTH_ERROR_INTERNAL;
+ }
+ g_variant_unref(result);
g_object_unref(device_proxy);
return ret;