}
}
-done:
/* +XSAT: 11,DISC */
xsat_ptr = strstr(s, "11,DISC,");
if (xsat_ptr) {
if (g_strcmp0(method_name, "NewConnection") == 0) {
gint32 fd;
- int index;
+ int index = 0;
GDBusMessage *msg;
GUnixFDList *fd_list;
- GVariant *options;
+ GVariant *options = NULL;
int device_count = 0;
- GSList *l;
device_count = g_slist_length(active_devices);
if (ret)
goto fail;
- if (local_addr)
- g_free(local_addr);
-
- local_addr = g_strdup(address);
- DBG("Address = %s\n", local_addr);
+ DBG("Address = %s\n", address);
g_dbus_method_invocation_return_value(invocation, NULL);
} else if (g_strcmp0(method_name, "UnregisterApplication") == 0) {
gchar *path = NULL;
g_dbus_method_invocation_return_value(invocation, NULL);
} else if (g_strcmp0(method_name, "IncomingCall") == 0) {
- gchar *path;
- gchar *number;
- gint call_id;
+ gchar *path = NULL;
+ gchar *number = NULL;
+ gint call_id = 0;
g_variant_get(parameters, "(&s&si)", &path, &number, &call_id);
goto fail;
g_dbus_method_invocation_return_value(invocation, NULL);
} else if (g_strcmp0(method_name, "OutgoingCall") == 0) {
- gchar *path;
- gchar *number;
- gint call_id;
+ gchar *path = NULL;
+ gchar *number = NULL;
+ gint call_id = 0;
g_variant_get(parameters, "(&s&si)", &path, &number, &call_id);
goto fail;
g_dbus_method_invocation_return_value(invocation, NULL);
} else if (g_strcmp0(method_name, "ChangeCallStatus") == 0) {
- gchar *path;
- gchar *number;
- gint status;
- gint call_id;
+ gchar *path = NULL;
+ gchar *number = NULL;
+ gint status = 0;
+ gint call_id = 0;
GSList *l;
g_variant_get(parameters, "(&s&sii)",
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(q)", gain_value));
} else if (g_strcmp0(method_name, "SetSpeakerGain") == 0) {
- guint16 gain;
+ guint16 gain = 0;
bt_ag_info_t *bt_ag_info = __bt_get_active_headset(remote_dev_path);
g_variant_get(parameters, "(q)", &gain);
g_dbus_method_invocation_return_value(invocation, NULL);
} else if (g_strcmp0(method_name, "GetMicrophoneGain") == 0) {
bt_ag_slconn_t *slconn = NULL;
- guint16 gain_value;
+ guint16 gain_value = 0;
bt_ag_info_t *bt_ag_info = __bt_get_active_headset(remote_dev_path);
if (bt_ag_info == NULL) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(q)", gain_value));
} else if (g_strcmp0(method_name, "SetMicrophoneGain") == 0) {
- guint16 gain;
+ guint16 gain = 0;
bt_ag_info_t *bt_ag_info = __bt_get_active_headset(remote_dev_path);
g_variant_get(parameters, "(q)", &gain);
{
FN_START;
char *path = NULL;
- GVariant *optional_param;
+ GVariant *optional_param = NULL;
if (strcasecmp(signal_name, "InterfacesAdded") == 0) {
g_variant_get(parameters, "(&o@a{sa{sv}})",
&path, &optional_param);
if (!path) {
+ if (optional_param)
+ g_variant_unref(optional_param);
ERR("Invalid adapter path");
return;
}
} else if (strcasecmp(signal_name, "InterfacesRemoved") == 0) {
g_variant_get(parameters, "(&o@as)", &path, &optional_param);
if (!path) {
+ if (optional_param)
+ g_variant_unref(optional_param);
ERR("Invalid adapter path");
return;
}
}
}
+ if (optional_param)
+ g_variant_unref(optional_param);
+
FN_END;
}
if (transport_state == MEDIA_TRANSPORT_STATE_PLAYING) {
GDBusProxy *proxy;
- GVariant *ret;
GError *err = NULL;
proxy = g_dbus_proxy_new_sync(ag_dbus_conn,
iter, "{sv}", &key, &value_var)) {
DBG("key %s", key);
if (g_strcmp0(key, "State") == 0) {
- value = g_variant_get_string(
+ value = (gchar *)g_variant_get_string(
value_var,
NULL);
DBG("value %s", value);
}
}
+ if (dict_param)
+ g_variant_unref(dict_param);
+
+ if (optional_param)
+ g_variant_unref(optional_param);
+
FN_END;
}
#endif
INFO_C("Starting Bluetooth AG agent");
- g_type_init();
-
ag_features = __bt_ag_agent_get_ag_features();
ag.sdp_features = (uint16_t) ag_features & 0x1F;