pci: memory leak of PCIDevice::rom_file

PCIDevice::rom_file is leaked.
PCIDevice::rom_file is allocated in pci_qdev_init(), but not freed anywhere.
free it in qemu_unregister_device().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Isaku Yamahata 2011-01-24 19:00:47 +09:00 committed by Michael S. Tsirkin
parent e10990c3f0
commit be7052c2a8
1 changed files with 1 additions and 0 deletions

View File

@ -833,6 +833,7 @@ static int pci_unregister_device(DeviceState *dev)
pci_unregister_io_regions(pci_dev);
pci_del_option_rom(pci_dev);
qemu_free(pci_dev->romfile);
do_pci_unregister_device(pci_dev);
return 0;
}