PCIDevice::romfile is allocatedi n pci_qdev_init(). But nowhere freed. Free it in do_pci_unregister_device().
Cc: Gerd Hoffmann <kra...@redhat.com> Signed-off-by: Isaku Yamahata <yamah...@valinux.co.jp> --- 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