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);
" </interface>"
"</node>";
-GDBusNodeInfo *node_info = NULL;
static gboolean name_acquired = FALSE;
static char *current_sender_playing = NULL;
g_object_unref(bt_service_conn);
bt_service_conn = NULL;
}
- if (node_info) {
- g_dbus_node_info_unref(node_info);
- node_info = NULL;
- }
if (owner_id > 0) {
g_bus_unown_name(owner_id);
owner_id = 0;
}
connected_device = g_malloc0(sizeof(bt_connected_headset_data_t));
- /* Fix : NULL_RETURNS */
- if (connected_device == NULL) {
- BT_ERR("No memory allocated");
- return;
- }
connected_device->device_state = status;
if ((status == BT_STATE_CONNECTED) || (status == BT_STATE_CONNECTING))
_bt_convert_addr_type_to_string(address, device_address->addr);
func_data = g_malloc0(sizeof(bt_audio_function_data_t));
- /* Fix : NULL_RETURNS */
- if (func_data == NULL) {
- result = BLUETOOTH_ERROR_MEMORY_ALLOCATION;
- goto fail;
- }
func_data->address = g_strdup(address);
func_data->req_id = request_id;
_bt_convert_addr_type_to_string(address, device_address->addr);
func_data = g_malloc0(sizeof(bt_audio_function_data_t));
- /* Fix : NULL_RETURNS */
- if (func_data == NULL) {
- BT_ERR("Memory allocation error");
- result = BLUETOOTH_ERROR_MEMORY_ALLOCATION;
- goto fail;
- }
func_data->address = g_strdup(address);
func_data->req_id = request_id;
func_data->pending = BT_PENDING_NONE;
}
func_data = g_malloc0(sizeof(bt_function_data_t));
- /* Fix : NULL_RETURNS */
- if (func_data == NULL) {
- result = BLUETOOTH_ERROR_MEMORY_ALLOCATION;
- goto fail;
- }
-
func_data->address = g_strdup(address);
func_data->req_id = request_id;
uuid = g_strdup(HFP_AG_UUID);
}
func_data = g_malloc0(sizeof(bt_function_data_t));
- /* Fix : NULL_RETURNS */
- if (func_data == NULL) {
- result = BLUETOOTH_ERROR_MEMORY_ALLOCATION;
- goto fail;
- }
-
func_data->address = g_strdup(address);
func_data->req_id = request_id;
uuid = g_strdup(HFP_AG_UUID);
}
conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
- retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
if (conn == NULL) {
BT_ERR("conn == NULL");
if (err) {
}
conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
- retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
if (conn == NULL) {
BT_ERR("conn == NULL");
if (err) {
return FALSE;
server = g_malloc0(sizeof(bt_agent_osp_server_t));
- retv_if(server == NULL, FALSE);
-
server->type = type;
if (type == BT_RFCOMM_SERVER) {
server->uuid = g_strdup(uuid);
_bt_convert_addr_type_to_string(address, device_address->addr);
func_data = g_malloc0(sizeof(bt_function_data_t));
- /* Fix : NULL_RETURNS */
- retv_if(func_data == NULL, BLUETOOTH_ERROR_MEMORY_ALLOCATION);
-
func_data->address = g_strdup(address);
func_data->req_id = request_id;
uuid = HID_UUID;
_bt_convert_addr_type_to_string(address, device_address->addr);
func_data = g_malloc0(sizeof(bt_function_data_t));
- /* Fix : NULL_RETURNS */
- retv_if(func_data == NULL, BLUETOOTH_ERROR_MEMORY_ALLOCATION);
-
func_data->address = g_strdup(address);
func_data->req_id = request_id;
}
buf = g_malloc0(20);
- /* Fix : NULL_RETURNS */
- if (buf == NULL) {
- close(fd);
- return NULL;
- }
if (read(fd, buf, 17) < 17) {
perror("Can't load firmware");