diff --git a/migration/socket.c b/migration/socket.c index 239527fb1f..49bacf78fd 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -199,6 +199,7 @@ static void socket_start_incoming_migration(SocketAddress *saddr, return; } migrate_add_address(address); + qapi_free_SocketAddress(address); } } 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); diff --git a/tests/test-bdrv-graph-mod.c b/tests/test-bdrv-graph-mod.c index 458dfa6661..283dc84869 100644 --- a/tests/test-bdrv-graph-mod.c +++ b/tests/test-bdrv-graph-mod.c @@ -114,6 +114,7 @@ static void test_update_perm_tree(void) bdrv_append(filter, bs, &local_err); g_assert_nonnull(local_err); + error_free(local_err); bdrv_unref(bs); blk_unref(root); diff --git a/tests/test-char.c b/tests/test-char.c index de328380c1..95ccfd3cdb 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -745,7 +745,7 @@ static void char_socket_server_test(gconstpointer opaque) Visitor *v; QemuThread thread; int ret; - bool reconnected; + bool reconnected = false; char *optstr; QemuOpts *opts;