};
static GDBusNodeInfo *__bt_gatt_create_method_node_info(
- const gchar *introspection_data)
+ const gchar *introspection_data)
{
GError *err = NULL;
- GDBusNodeInfo *obj_info = NULL;
+ GDBusNodeInfo *node_info = NULL;
if (introspection_data == NULL)
return NULL;
+
BT_DBG("Create new node info");
- obj_info = g_dbus_node_info_new_for_xml(introspection_data, &err);
+ node_info = g_dbus_node_info_new_for_xml(introspection_data, &err);
if (err) {
BT_ERR("Unable to create node: %s", err->message);
return NULL;
}
- return obj_info;
+ return node_info;
}
static struct gatt_service_info *__bt_gatt_find_gatt_service_info(
char_info = __bt_gatt_find_gatt_char_info(serv_path, char_path);
if (char_info == NULL) {
g_strfreev(line_argv);
+ g_free(serv_path);
return BLUETOOTH_ERROR_INVALID_PARAM;
}
if (node_info == NULL) {
g_strfreev(line_argv);
+ g_free(serv_path);
return BLUETOOTH_ERROR_INTERNAL;
}
g_error_free(error);
g_free(path);
g_strfreev(line_argv);
+ g_free(serv_path);
return BLUETOOTH_ERROR_INTERNAL;
}
*desc_path = g_strdup(path);
g_free(path);
+ g_free(serv_path);
g_strfreev(line_argv);
g_variant_builder_unref(inner_builder);
g_variant_builder_unref(builder);
if (!__bt_gatt_get_service_state(serv_path)) {
BT_DBG("service not registered for this characteristic \n");
+ g_free(serv_path);
g_strfreev(line_argv);
return BLUETOOTH_ERROR_INTERNAL;
}
char_info = __bt_gatt_find_gatt_char_info(serv_path, char_path);
if (char_info == NULL) {
+ g_free(serv_path);
+ g_strfreev(line_argv);
+ g_variant_builder_unref(inner_builder);
+ g_variant_builder_unref(outer_builder);
+ g_variant_builder_unref(invalidated_builder);
+
return BLUETOOTH_ERROR_INVALID_DATA;
}
}
}
+ g_free(serv_path);
g_strfreev(line_argv);
g_variant_builder_unref(inner_builder);
g_variant_builder_unref(outer_builder);
if (req_info) {
if (resp_state != BLUETOOTH_ERROR_NONE) {
-
- GQuark quark = g_quark_from_string("gatt-server");
- GError *err = g_error_new(quark, 0, "Application Error");
- g_dbus_method_invocation_return_gerror(req_info->context, err);
- g_error_free(err);
+ g_dbus_method_invocation_return_dbus_error(req_info->context,
+ "org.bluez.Error.Failed", "Application Error");
gatt_requests = g_slist_remove(gatt_requests, req_info);
if (!__bt_gatt_get_service_state(serv_path)) {
BT_DBG("service not registered for this characteristic \n");
+ g_free(serv_path);
g_strfreev(line_argv);
return BLUETOOTH_ERROR_INTERNAL;
}
+ g_free(serv_path);
+
outer_builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
invalidated_builder = g_variant_builder_new(G_VARIANT_TYPE("as"));