]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commitdiff
libqos: Fixes a small memory leak.
authorJohn Snow <jsnow@redhat.com>
Mon, 4 Aug 2014 21:11:23 +0000 (17:11 -0400)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 15 Aug 2014 17:03:13 +0000 (18:03 +0100)
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>
tests/libqos/pci-pc.c
tests/libqos/pci-pc.h

index 4adf4006aedd713041b8962a307804ff468832c5..f5d646984ce271176109e2c44ba5b42cd87c2f9f 100644 (file)
@@ -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);
+}
index 4f7475f6f75a78bbe50fe7563b53c6b5bd8ff221..26211790cd19af6c5bc028cb628b35435387ace5 100644 (file)
@@ -16,5 +16,6 @@
 #include "libqos/pci.h"
 
 QPCIBus *qpci_init_pc(void);
+void     qpci_free_pc(QPCIBus *bus);
 
 #endif