From 3b6b0a8ae7b437256aba3b44643a7a608d54b916 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 13 Nov 2018 16:03:21 +0100 Subject: [PATCH] tests/ide: Free pcibus when finishing a test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Once a test has finished, the pcibus structure should be freed, to avoid leaking memory and to make sure that the structure is properly re-initialized when the next test starts. Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: John Snow Signed-off-by: Thomas Huth --- tests/ide-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ide-test.c b/tests/ide-test.c index 33cef61e1f..f0280e636b 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -142,6 +142,10 @@ static void ide_test_start(const char *cmdline_fmt, ...) static void ide_test_quit(void) { + if (pcibus) { + qpci_free_pc(pcibus); + pcibus = NULL; + } pc_alloc_uninit(guest_malloc); guest_malloc = NULL; qtest_end();