parameters = g_variant_new("(a{sv}as)", inner_builder, invalidated_builder);
g_variant_builder_unref(invalidated_builder);
g_variant_builder_unref(inner_builder);
- } else if (BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED) {
+ } else if (event == BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED) {
GVariantBuilder *inner_builder;
GVariantBuilder *invalidated_builder;
parameters = g_variant_new("(a{sv}as)", inner_builder, invalidated_builder);
g_variant_builder_unref(invalidated_builder);
g_variant_builder_unref(inner_builder);
+ } else {
+ g_varaiant_unref(var);
}
msg = g_dbus_message_new_signal(BT_HPS_OBJECT_PATH, BT_HPS_INTERFACE_NAME, PROPERTIES_CHANGED);
if (response_needed)
g_dbus_method_invocation_return_value(invocation, NULL);
else
- g_object_unref (invocation);
+ g_object_unref(invocation);
return;
}
if (response_needed)
g_dbus_method_invocation_return_value(invocation, NULL);
else
- g_object_unref (invocation);
+ g_object_unref(invocation);
return;
}
char *data;
value_change.att_value = (guint8 *)g_malloc(len);
- if (!value_change.att_value) {
- BT_ERR("att_value is NULL");
- g_variant_unref(var);
- if (response_needed)
- g_dbus_method_invocation_return_value(invocation, NULL);
- else
- g_object_unref (invocation);
- return;
- }
data = (char *)g_variant_get_data(var);
memcpy(value_change.att_value, data, len);
req_info->context = invocation;
gatt_requests = g_slist_append(gatt_requests, req_info);
} else {
- g_object_unref (invocation);
+ g_object_unref(invocation);
}
_bt_common_event_cb(
if (response_needed)
g_dbus_method_invocation_return_value(invocation, NULL);
else
- g_object_unref (invocation);
+ g_object_unref(invocation);
return;
}
if (response_needed)
g_dbus_method_invocation_return_value(invocation, NULL);
else
- g_object_unref (invocation);
+ g_object_unref(invocation);
return;
}
char *data;
value_change.att_value = (guint8 *)g_malloc(len);
- if (!value_change.att_value) {
- BT_ERR("att_value is NULL");
- g_variant_unref(var);
- if (response_needed)
- g_dbus_method_invocation_return_value(invocation, NULL);
- else
- g_object_unref (invocation);
- return;
- }
+
data = (char *)g_variant_get_data(var);
memcpy(value_change.att_value, data, len);
}
req_info->context = invocation;
gatt_requests = g_slist_append(gatt_requests, req_info);
} else {
- g_object_unref (invocation);
+ g_object_unref(invocation);
}
_bt_common_event_cb(
NULL, /* GDBusAuthObserver */
NULL,
&err);
+ g_free(address);
if (!g_conn) {
if (err) {
BT_ERR("Unable to connect to dbus: %s", err->message);
NULL, /* GDBusAuthObserver */
NULL,
&err);
-
+ g_free(address);
if (!local_system_gconn) {
BT_ERR("Unable to connect to dbus: %s", err->message);
g_clear_error(&err);
/* Register ObjectManager interface */
node_info = __bt_gatt_create_method_node_info(
manager_introspection_xml);
-
if (node_info == NULL) {
BT_ERR("failed to get node info");
goto failed;
&manager_interface_vtable,
NULL, NULL, &error);
}
-
+ g_dbus_node_info_unref(node_info);
if (manager_id == 0) {
BT_ERR("failed to register: %s", error->message);
g_error_free(error);
node_info = __bt_gatt_create_method_node_info(
service_introspection_xml);
-
if (node_info == NULL)
return BLUETOOTH_ERROR_INTERNAL;
node_info->interfaces[0],
&serv_interface_vtable,
NULL, NULL, &error);
+ g_dbus_node_info_unref(node_info);
if (object_id == 0) {
BT_ERR("failed to register: %s", error->message);
node_info = __bt_gatt_create_method_node_info(
characteristics_introspection_xml);
-
if (node_info == NULL)
return BLUETOOTH_ERROR_INTERNAL;
node_info->interfaces[0],
&char_interface_vtable,
NULL, NULL, &error);
+ g_dbus_node_info_unref(node_info);
if (object_id == 0) {
BT_ERR("failed to register: %s", error->message);
node_info = __bt_gatt_create_method_node_info(
descriptor_introspection_xml);
-
if (node_info == NULL) {
g_strfreev(line_argv);
g_free(serv_path);
node_info->interfaces[0],
&desc_interface_vtable,
NULL, NULL, &error);
+ g_dbus_node_info_unref(node_info);
if (object_id == 0) {
BT_ERR("failed to register: %s", error->message);
g_strfreev(line_argv);
g_variant_builder_unref(inner_builder);
g_variant_builder_unref(builder);
+ g_variant_builder_unref(builder2);
return BLUETOOTH_ERROR_NONE;
}
return BLUETOOTH_ERROR_INTERNAL;
}
+/* Fix the svace issue : 185689
outer_builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
+*/
invalidated_builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
inner_builder = g_variant_builder_new(G_VARIANT_TYPE_ARRAY);
update_value = g_variant_new("ay", inner_builder);
+
outer_builder = g_variant_builder_new(G_VARIANT_TYPE_ARRAY);
g_variant_builder_add(outer_builder, "{sv}", "Value",
update_value);