[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 1/3] pci: fix memory leak of PCIDevice::romfile.
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH v2 1/3] pci: fix memory leak of PCIDevice::romfile. |
Date: |
Tue, 22 Jun 2010 11:55:33 +0900 |
PCIDevice::romfile is allocatedi n pci_qdev_init(). But nowhere freed.
Free it in do_pci_unregister_device().
Cc: Gerd Hoffmann <address@hidden>
Signed-off-by: Isaku Yamahata <address@hidden>
---
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,
--
1.6.6.1