Received: from eggs.gnu.org ([2001:4830:134:3::10]:50150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIKyu-0006O2-M6 for qemu-devel@nongnu.org; Fri, 15 Aug 2014 13:08:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIKyo-0000I9-HT for qemu-devel@nongnu.org; Fri, 15 Aug 2014 13:08:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29718) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIKyo-0000I2-8q for qemu-devel@nongnu.org; Fri, 15 Aug 2014 13:07:54 -0400 From: Stefan Hajnoczi Date: Fri, 15 Aug 2014 18:06:29 +0100 Message-Id: <1408122422-13935-23-git-send-email-stefanha@redhat.com> In-Reply-To: <1408122422-13935-1-git-send-email-stefanha@redhat.com> References: <1408122422-13935-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 22/55] libqos: Fixes a small memory leak. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , John Snow , Stefan Hajnoczi From: John Snow 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 Signed-off-by: Stefan Hajnoczi --- 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