The value returned from object_get_canonical_path_component must be freed. Signed-off-by: Yang Hongyang <yan...@cn.fujitsu.com> Cc: Jason Wang <jasow...@redhat.com> Cc: Paolo Bonzini <pbonz...@redhat.com> --- net/net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/net.c b/net/net.c index 0c4a012..459bf19 100644 --- a/net/net.c +++ b/net/net.c @@ -1189,10 +1189,11 @@ void print_net_client(Monitor *mon, NetClientState *nc) monitor_printf(mon, "filters:\n"); } QTAILQ_FOREACH(nf, &nc->filters, next) { - monitor_printf(mon, " - %s: type=%s%s\n", - object_get_canonical_path_component(OBJECT(nf)), + char *path = object_get_canonical_path_component(OBJECT(nf)); + monitor_printf(mon, " - %s: type=%s%s\n", path, object_get_typename(OBJECT(nf)), nf->info_str); + g_free(path); } } -- 1.9.1