[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 22/28] libqos: Fixes a small memory leak.
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH 22/28] libqos: Fixes a small memory leak. |
Date: |
Mon, 7 Jul 2014 14:18:03 -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 bf741a4..e0396bd 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 15/28] ide: stop PIO transfer on errors, (continued)
- [Qemu-devel] [PATCH 15/28] ide: stop PIO transfer on errors, John Snow, 2014/07/07
- [Qemu-devel] [PATCH 17/28] ahci: construct PIO Setup FIS for PIO commands, John Snow, 2014/07/07
- [Qemu-devel] [PATCH 18/28] q35: Enable the ioapic device to be seen by qtest., John Snow, 2014/07/07
- [Qemu-devel] [PATCH 21/28] libqtest: Correct small memory leak., John Snow, 2014/07/07
- [Qemu-devel] [PATCH 27/28] ahci: Add test_hba_enable to ahci-test., John Snow, 2014/07/07
- [Qemu-devel] [PATCH 22/28] libqos: Fixes a small memory leak.,
John Snow <=
- [Qemu-devel] [PATCH 20/28] libqos: Correct memory leak, John Snow, 2014/07/07
- [Qemu-devel] [PATCH 19/28] qtest: Adding qtest_memset and qmemset., John Snow, 2014/07/07
- [Qemu-devel] [PATCH 23/28] ahci: Adding basic functionality qtest., John Snow, 2014/07/07
- [Qemu-devel] [PATCH 28/28] ahci: Add test_identify case to ahci-test., John Snow, 2014/07/07
- [Qemu-devel] [PATCH 24/28] ahci: Add test_pci_spec to ahci-test., John Snow, 2014/07/07