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>
This commit is contained in:
John Snow 2014-08-04 17:11:23 -04:00 committed by Stefan Hajnoczi
parent a7afc6b8c1
commit 7f2a5ae6c1
2 changed files with 8 additions and 0 deletions

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

View File

@ -16,5 +16,6 @@
#include "libqos/pci.h"
QPCIBus *qpci_init_pc(void);
void qpci_free_pc(QPCIBus *bus);
#endif