vhost-user-test: fix leaks

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: ae31fb5491 and 4d3f50eb48
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Marc-André Lureau 2019-03-05 23:51:35 +01:00 committed by Thomas Huth
parent 13ee9e30c8
commit 5411f3d0a2
1 changed files with 3 additions and 0 deletions

View 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);
}