aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/pci-pc.c
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2014-08-04 17:11:23 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2014-08-15 18:03:13 +0100
commit7f2a5ae6c1194b1676f1a7239fbcacd9d59637be (patch)
tree111780931fac795efe6bd904703f8b9ee181f98c /tests/libqos/pci-pc.c
parenta7afc6b8c13c70e9c40b4f666be80600f8ad0b3d (diff)
libqos: Fixes a small memory leak.
Allow users the chance to clean up the QPCIBusPC structure by adding a small cleanup routine. Helps clear up small memory leaks during setup/teardown, to allow for cleaner debug output messages. Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/libqos/pci-pc.c')
-rw-r--r--tests/libqos/pci-pc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c
index 4adf4006ae..f5d646984c 100644
--- a/tests/libqos/pci-pc.c
+++ b/tests/libqos/pci-pc.c
@@ -237,3 +237,10 @@ QPCIBus *qpci_init_pc(void)
return &ret->bus;
}
+
+void qpci_free_pc(QPCIBus *bus)
+{
+ QPCIBusPC *s = container_of(bus, QPCIBusPC, bus);
+
+ g_free(s);
+}