]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
vhost-user-test: fix leaks
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 5 Mar 2019 22:51:35 +0000 (23:51 +0100)
committerThomas Huth <thuth@redhat.com>
Fri, 8 Mar 2019 07:00:19 +0000 (08:00 +0100)
Spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Fixes: ae31fb54914 and 4d3f50eb489
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/vhost-user-test.c

index 83ea15f37e2d64509aecc62e5c2feb5f71505025..14a1e2fbac523a00522b05b779f285958a76e8d6 100644 (file)
@@ -588,6 +588,7 @@ static void test_server_free(TestServer *server)
         g_test_message("unable to rmdir: path (%s): %s",
                        server->tmpfs, strerror(errno));
     }
+    g_free(server->tmpfs);
 
     qemu_chr_fe_deinit(&server->chr, true);
 
@@ -605,6 +606,8 @@ static void test_server_free(TestServer *server)
 
     g_main_loop_unref(server->loop);
     g_main_context_unref(server->context);
+    g_cond_clear(&server->data_cond);
+    g_mutex_clear(&server->data_mutex);
     g_free(server);
 }