From patchwork Tue Jun 22 02:55:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2,1/3] pci: fix memory leak of PCIDevice::romfile. Date: Mon, 21 Jun 2010 16:55:33 -0000 From: Isaku Yamahata X-Patchwork-Id: 56393 Message-Id: <194431c7d3de831a5084a63447401d2a0883d13c.1277174072.git.yamahata@valinux.co.jp> To: qemu-devel@nongnu.org Cc: yamahata@valinux.co.jp, kraxel@redhat.com, mst@redhat.com PCIDevice::romfile is allocatedi n pci_qdev_init(). But nowhere freed. Free it in do_pci_unregister_device(). Cc: Gerd Hoffmann Signed-off-by: Isaku Yamahata --- hw/pci.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 7787005..7e5c539 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -650,6 +650,7 @@ static void do_pci_unregister_device(PCIDevice *pci_dev) qemu_free_irqs(pci_dev->irq); pci_dev->bus->devices[pci_dev->devfn] = NULL; pci_config_free(pci_dev); + qemu_free(pci_dev->romfile); } PCIDevice *pci_register_device(PCIBus *bus, const char *name,