From 1e25879e6f832373775492c11c648ab2fff69bd5 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 12 Mar 2019 15:07:22 +0100 Subject: [PATCH] test-migration: fix memory leak Reported by ASAN. Signed-off-by: Paolo Bonzini --- tests/migration-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index 48dc20a2ae..bd3f5c3125 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -382,9 +382,10 @@ static char *migrate_get_socket_address(QTestState *who, const char *parameter) iv = qobject_input_visitor_new(object); visit_type_SocketAddressList(iv, NULL, &addrs, &local_err); + visit_free(iv); /* we are only using a single address */ - result = g_strdup_printf("%s", SocketAddress_to_str(addrs->value)); + result = SocketAddress_to_str(addrs->value); qapi_free_SocketAddressList(addrs); qobject_unref(rsp);