mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-08 00:24:59 +00:00
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:
parent
e10990c3f0
commit
be7052c2a8
1
hw/pci.c
1
hw/pci.c
@ -833,6 +833,7 @@ static int pci_unregister_device(DeviceState *dev)
|
|||||||
|
|
||||||
pci_unregister_io_regions(pci_dev);
|
pci_unregister_io_regions(pci_dev);
|
||||||
pci_del_option_rom(pci_dev);
|
pci_del_option_rom(pci_dev);
|
||||||
|
qemu_free(pci_dev->romfile);
|
||||||
do_pci_unregister_device(pci_dev);
|
do_pci_unregister_device(pci_dev);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user