g_variant_get(folder_list_var, "(aa{sv})", &iter);
folders_struct.size = g_variant_iter_n_children(iter);
- folders_struct.names = (char**) malloc(folders_struct.size * sizeof(*(folders_struct.names)));
+ folders_struct.names = (char**) g_malloc0(folders_struct.size * sizeof(*(folders_struct.names)));
BT_DBG("g_variant_iter_n_children: %d", folders_struct.size);
GVariantIter* res = NULL;
int i = 0;
free(folders_struct.names[i]);
folders_struct.names[i] = NULL;
}
- free(folders_struct.names);
+ g_free(folders_struct.names);
g_variant_unref(folder_list_var);
fields_info.size = g_variant_iter_n_children(iter);
char* field = NULL;
- fields_info.fields = malloc(fields_info.size * sizeof(char*));
+ fields_info.fields = g_malloc0(fields_info.size * sizeof(char*));
while (g_variant_iter_loop(iter, "s", &field)) {
fields_info.fields[i] = strdup(field);
i++;
free(fields_info.fields[i]);
fields_info.fields[i] = NULL;
}
- free(fields_info.fields);
+ g_free(fields_info.fields);
__bt_remove_push_request_id(request_id);
g_variant_unref(value);
g_variant_get(messages_list_var, "(a{oa{sv}})", &iter);
messages_struct.size = g_variant_iter_n_children(iter);
messages_struct.message_items = (bt_map_client_message_item_t*)
- malloc(messages_struct.size * sizeof(*(messages_struct.message_items)));
+ g_malloc(messages_struct.size * sizeof(*(messages_struct.message_items)));
BT_DBG("g_variant_iter_n_children: %d", messages_struct.size);
char *object = NULL;
free(messages_struct.message_items[i].type);
free(messages_struct.message_items[i].status);
}
- free(messages_struct.message_items);
+ g_free(messages_struct.message_items);
g_variant_unref(messages_list_var);
} else if (strcasecmp(signal_name, BT_MAP_GET_MESSAGE_COMPLETE) == 0) {
notify_read_info->offset_status = offset_status;
notify_read_info->https_status = https_status;
hps_notify_read_list = g_slist_insert_sorted(hps_notify_read_list,
- notify_read_info, notify_info_cmp);
+ notify_read_info, notify_info_cmp);
return;
}
}
hps_notify_read_list = g_slist_append(hps_notify_read_list, notify_read_info);
}
return;
- } else {
- /* Store Notification information */
- notify_read_info = g_new0(struct hps_notify_read_info, 1);
- if (notify_read_info) {
- notify_read_info->char_path = g_strdup(obj_path);
- notify_read_info->read_status = read_status;
- notify_read_info->offset_status = offset_status;
- notify_read_info->https_status = https_status;
- hps_notify_read_list = g_slist_append(hps_notify_read_list, notify_read_info);
- }
- return;
+ }
+
+ /* Store Notification information */
+ notify_read_info = g_new0(struct hps_notify_read_info, 1);
+ if (notify_read_info) {
+ notify_read_info->char_path = g_strdup(obj_path);
+ notify_read_info->read_status = read_status;
+ notify_read_info->offset_status = offset_status;
+ notify_read_info->https_status = https_status;
+ hps_notify_read_list = g_slist_append(hps_notify_read_list, notify_read_info);
}
}