int i = 0;
gchar **line_argv = NULL;
gchar *serv_path = NULL;
+ const char *value = NULL;
line_argv = g_strsplit_set(char_path, "/", 0);
serv_path = g_strdup_printf("/%s/%s/%s", line_argv[1], line_argv[2], line_argv[3]);
char_info->value_length = value_length;
- char_info->char_value = (char *)realloc(char_info->char_value, value_length);
+ value = (char *)realloc(char_info->char_value, value_length);
+ if (value == 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_MEMORY_ALLOCATION;
+ }
+
+ char_info->char_value = (char*)value;
if (char_info->char_value) {
for (i = 0; i < value_length; i++)
char_info->char_value[i] = char_value[i];
return __bt_hdp_add_filter_subscribe_signal(g_hdp_dus_conn, TRUE);
-
- BT_DBG("-\n");
}
static void __bt_hdp_internal_event_filter(GDBusConnection *connection,