const char *string;
};
+static void free_range(void *range, void *dummy)
+{
+ g_free(range);
+}
+
static void parse_str(StringInputVisitor *siv, Error **errp)
{
char *str = (char *) siv->string;
return;
error:
- g_list_free_full(siv->ranges, g_free);
- assert(siv->ranges == NULL);
+ g_list_foreach(siv->ranges, free_range, NULL);
+ g_list_free(siv->ranges);
+ siv->ranges = NULL;
}
static void
void string_input_visitor_cleanup(StringInputVisitor *v)
{
- g_list_free_full(v->ranges, g_free);
+ g_list_foreach(v->ranges, free_range, NULL);
+ g_list_free(v->ranges);
g_free(v);
}
return &sov->visitor;
}
+static void free_range(void *range, void *dummy)
+{
+ g_free(range);
+}
+
void string_output_visitor_cleanup(StringOutputVisitor *sov)
{
if (sov->string) {
g_string_free(sov->string, true);
}
- g_list_free_full(sov->ranges, g_free);
+ g_list_foreach(sov->ranges, free_range, NULL);
+ g_list_free(sov->ranges);
g_free(sov);
}