Message ID | 1466011636-6112-2-git-send-email-armbru@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 06/15/2016 11:27 AM, Markus Armbruster wrote: > -dfilter overwrites any previous filter. The overwritten filter is > leaked. Leaks since the beginning (commit 3514552, v2.6.0). Free it > properly. > > Signed-off-by: Markus Armbruster <armbru@redhat.com> > --- > util/log.c | 7 +++++++ > 1 file changed, 7 insertions(+) > Reviewed-by: Eric Blake <eblake@redhat.com>
diff --git a/util/log.c b/util/log.c index 5ad72c1..6f45e0a 100644 --- a/util/log.c +++ b/util/log.c @@ -145,9 +145,16 @@ bool qemu_log_in_addr_range(uint64_t addr) void qemu_set_dfilter_ranges(const char *filter_spec) { gchar **ranges = g_strsplit(filter_spec, ",", 0); + + if (debug_regions) { + g_array_unref(debug_regions); + debug_regions = NULL; + } + if (ranges) { gchar **next = ranges; gchar *r = *next++; + debug_regions = g_array_sized_new(FALSE, FALSE, sizeof(Range), g_strv_length(ranges)); while (r) {
-dfilter overwrites any previous filter. The overwritten filter is leaked. Leaks since the beginning (commit 3514552, v2.6.0). Free it properly. Signed-off-by: Markus Armbruster <armbru@redhat.com> --- util/log.c | 7 +++++++ 1 file changed, 7 insertions(+)