static gboolean __bt_hal_pincode_request(GapAgentPrivate *agent, GDBusProxy *device)
{
uint32_t device_class;
- const gchar *address;
+ gchar *address;
unsigned char auth_info[5] = {0, };
- const gchar *name;
+ gchar *name;
GVariant *reply = NULL;
GVariant *reply_temp = NULL;
GVariant *tmp_value;
}
done:
+ g_free(name);
+ g_free(address);
g_variant_unref(reply);
g_variant_unref(reply_temp);
__bt_hal_agent_release_memory();
static gboolean __bt_hal_display_request(GapAgentPrivate *agent, GDBusProxy *device,
guint passkey)
{
- const gchar *address;
- const gchar *name;
+ gchar *address;
+ gchar *name;
unsigned char auth_info[5] = {0, };
char *str_passkey;
uint32_t device_class;
g_free(str_passkey);
done:
+ g_free(name);
+ g_free(address);
g_variant_unref(reply);
g_variant_unref(reply_temp);
__bt_hal_agent_release_memory();
/* SSP */
static gboolean __bt_hal_passkey_request(GapAgentPrivate *agent, GDBusProxy *device)
{
- const gchar *address;
- const gchar *name;
+ gchar *address;
+ gchar *name;
unsigned char auth_info[5] = {0, };
uint32_t device_class;
GVariant *reply = NULL;
}
done:
+ g_free(name);
+ g_free(address);
g_variant_unref(reply);
g_variant_unref(reply_temp);
__bt_hal_agent_release_memory();
static gboolean __bt_hal_confirm_request(GapAgentPrivate *agent, GDBusProxy *device,
guint passkey)
{
- const gchar *address;
- const gchar *name;
+ gchar *address;
+ gchar *name;
char str_passkey[7];
uint32_t device_class;
GVariant *reply_temp = NULL;
}
done:
+ g_free(name);
+ g_free(address);
g_variant_unref(reply);
g_variant_unref(reply_temp);
__bt_hal_agent_release_memory();
static gboolean __bt_hal_authorize_request(GapAgentPrivate *agent, GDBusProxy *device,
const char *uuid)
{
- const gchar *address;
- const gchar *name;
+ gchar *address;
+ gchar *name;
gboolean trust;
gboolean paired;
GVariant *reply = NULL;
}
done:
+ g_free(name);
+ g_free(address);
g_variant_unref(reply);
g_variant_unref(reply_temp);
__bt_hal_agent_release_memory();
if (obj_path == NULL) {
ERR("obj_path is NULL");
- return FALSE;
+ goto done;
}
if (strcasecmp(obj_path, BT_HAL_BLUEZ_HCI_PATH) == 0) {
if (g_strcmp0(g_variant_get_type_string(param->parameters), "(sss)") != 0) {
ERR("Invalid variant format");
- return FALSE;
+ goto done;
}
/* TODO: Handle Name Owener changed Signal */
if (__bt_hal_get_owner_info(param->parameters, &name, &previous, ¤t)) {
ERR("Fail to get the owner info");
- return FALSE;
+ goto done;
}
if (*current != '\0')
- return FALSE;
+ goto done;
if (name == NULL)
- return FALSE;
+ goto done;
if (strcasecmp(name, BT_HAL_BLUEZ_NAME) == 0) {
struct hal_ev_adapter_state_changed ev;
__bt_hal_handle_gatt_service_event(param->parameters, param->signal_name);
}
+done:
/* Free data */
g_free(param->sender_name);
g_free(param->object_path);
g_free(param->interface_name);
g_free(param->signal_name);
g_variant_unref(param->parameters);
+ g_free(param);
return FALSE;
}
address = g_malloc0(BT_HAL_ADDRESS_STRING_SIZE);
- /* Fix : NULL_RETURNS */
- if (address == NULL)
- return;
-
_bt_hal_convert_device_path_to_address(path, address);
__bt_hal_send_hf_audio_connection_state_event(property_flag, address);
g_free(address);
DBG("Sco Disconnected");
} else {
ERR("Not handled state - %s", state);
- g_free(state);
- return;
}
g_free(state);
} else if (strcasecmp(property, "SpeakerGain") == 0) {
g_free(address);
}
- if (property)
- g_free(property);
+ g_free(property);
g_variant_unref(value);
}
const char *path)
{
char *address;
- const char *property = NULL;
if (path == NULL)
return;
if (strcasecmp(member, "PropertyChanged") == 0) {
+ char *property;
g_variant_get(msg, "(s)", &property);
if (property == NULL)
return;
} else if (strcasecmp(property, "UUIDs") == 0) {
/* TODO */
}
+ g_free(property);
} else if (strcasecmp(member, "DeviceConnected") == 0) {
unsigned char addr_type = 0;