value = __bt_is_headset_connected(type, request_id, address);
if (value == BLUETOOTH_ERROR_ALREADY_CONNECT) {
- return BLUETOOTH_ERROR_ALREADY_CONNECT;
+ result = BLUETOOTH_ERROR_ALREADY_CONNECT;
+ goto fail;
} else if (value == BLUETOOTH_ERROR_NOT_CONNECTED) {
value = __bt_is_headset_connecting(type);
if (value != BLUETOOTH_ERROR_NONE) {
/* Add data to the connected list */
_bt_add_headset_to_list(type, BT_STATE_CONNECTING, address);
} else if (value == BLUETOOTH_ERROR_IN_PROGRESS) {
- return BLUETOOTH_ERROR_IN_PROGRESS;
+ result = BLUETOOTH_ERROR_IN_PROGRESS;
+ goto fail;
}
if (out_param1)
g_array_append_vals(out_param1, address,
BT_ADDRESS_STR_LEN);
+ g_free(func_data->address);
+ g_free(func_data);
+
return result;
}
g_array_append_vals(out_param1, address,
BT_ADDRESS_STR_LEN);
+ g_free(func_data->address);
+ g_free(func_data);
+
return result;
}
BT_INFO("device_path is created[%s]", device_path);
property_str = _bt_convert_property_to_string(property);
-
- if (property_str == NULL)
+ if (property_str == NULL) {
+ g_free(device_path);
return BLUETOOTH_ERROR_INTERNAL;
+ }
proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
NULL, BT_BLUEZ_NAME,
device_path, BT_PROPERTIES_INTERFACE, NULL, NULL);
g_free(device_path);
- retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
+ if (proxy == NULL) {
+ g_free(property_str);
+ return BLUETOOTH_ERROR_INTERNAL;
+ }
result = g_dbus_proxy_call_sync(proxy, "GetAll",
g_variant_new("(s)", BT_PROXIMITY_MONITOR_INTERFACE),
g_error_free(error);
}
g_object_unref(proxy);
+ g_free(property_str);
return BLUETOOTH_ERROR_INTERNAL;
}
g_variant_get(result , "(@a{sv})", &value);
if (tmp_value == NULL) {
g_object_unref(proxy);
g_variant_unref(value);
+ g_free(property_str);
return BLUETOOTH_ERROR_INTERNAL;
}
BT_INFO("device_path is created[%s]", device_path);
property_str = _bt_convert_property_to_string(property);
-
- if (property_str == NULL)
+ if (property_str == NULL) {
+ g_free(device_path);
return BLUETOOTH_ERROR_INTERNAL;
+ }
proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE,
NULL, BT_BLUEZ_NAME,
device_path, BT_PROPERTIES_INTERFACE, NULL, NULL);
g_free(device_path);
- retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
+ if (proxy == NULL) {
+ g_free(property_str);
+ return BLUETOOTH_ERROR_INTERNAL;
+ }
result = g_dbus_proxy_call_sync(proxy, "GetAll",
g_variant_new("(s)", BT_PROXIMITY_REPORTER_INTERFACE),
g_error_free(error);
}
g_object_unref(proxy);
+ g_free(property_str);
return BLUETOOTH_ERROR_INTERNAL;
}
g_variant_get(result , "(@a{sv})", &value);
if (tmp_value == NULL) {
g_object_unref(proxy);
g_variant_unref(value);
+ g_free(property_str);
return BLUETOOTH_ERROR_INTERNAL;
}