diff options
Diffstat (limited to 'qapi/string-output-visitor.c')
-rw-r--r-- | qapi/string-output-visitor.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/qapi/string-output-visitor.c b/qapi/string-output-visitor.c index 1c0834abad..8735b00448 100644 --- a/qapi/string-output-visitor.c +++ b/qapi/string-output-visitor.c @@ -316,13 +316,19 @@ Visitor *string_output_get_visitor(StringOutputVisitor *sov) 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); } |