diff options
author | Thomas Huth <thuth@redhat.com> | 2018-11-13 16:03:21 +0100 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2018-11-19 21:59:44 +0100 |
commit | 3b6b0a8ae7b437256aba3b44643a7a608d54b916 (patch) | |
tree | 5b34087fb52b4666816bf787ce2f18c4af991d95 /tests/ide-test.c | |
parent | 61793a627d10908715eac2fc4a25b724f43e8fda (diff) |
tests/ide: Free pcibus when finishing a test
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 <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/ide-test.c')
-rw-r--r-- | tests/ide-test.c | 4 |
1 files changed, 4 insertions, 0 deletions
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(); |