[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 22/30] libqos: Fixes a small memory leak.
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH v2 22/30] libqos: Fixes a small memory leak. |
Date: |
Mon, 4 Aug 2014 17:11:23 -0400 |
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 <address@hidden>
---
tests/libqos/pci-pc.c | 7 +++++++
tests/libqos/pci-pc.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c
index 4adf400..f5d6469 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);
+}
diff --git a/tests/libqos/pci-pc.h b/tests/libqos/pci-pc.h
index 4f7475f..2621179 100644
--- a/tests/libqos/pci-pc.h
+++ b/tests/libqos/pci-pc.h
@@ -16,5 +16,6 @@
#include "libqos/pci.h"
QPCIBus *qpci_init_pc(void);
+void qpci_free_pc(QPCIBus *bus);
#endif
--
1.9.3
- [Qemu-devel] [PATCH v2 14/30] ahci: remove duplicate PORT_IRQ_* constants, (continued)
- [Qemu-devel] [PATCH v2 14/30] ahci: remove duplicate PORT_IRQ_* constants, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 21/30] libqtest: Correct small memory leak., John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 19/30] qtest: Adding qtest_memset and qmemset., John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 26/30] ahci: Add test_pci_spec to ahci-test., John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 30/30] ahci: Add test_identify case to ahci-test., John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 24/30] qtest/ide: Fix small memory leak, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 29/30] ahci: Add test_hba_enable to ahci-test., John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 20/30] libqos: Correct memory leak, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 27/30] ahci: add test_pci_enable to ahci-test., John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 28/30] ahci: Add test_hba_spec to ahci-test., John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 22/30] libqos: Fixes a small memory leak.,
John Snow <=
- [Qemu-devel] [PATCH v2 23/30] libqos: allow qpci_iomap to return BAR mapping size, John Snow, 2014/08/04
- [Qemu-devel] [PATCH v2 25/30] ahci: Adding basic functionality qtest., John Snow, 2014/08/04
- Re: [Qemu-devel] [PATCH v2 00/30] AHCI test suite framework, Stefan Hajnoczi, 2014/08/06
- Re: [Qemu-devel] [PATCH v2 00/30] AHCI test suite framework, Stefan Hajnoczi, 2014/08/11