mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
libqos: remove some leaks
qpci_device_find() returns allocated data, don't leak it. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
1760048a5d
commit
ea53854a54
1 changed files with 2 additions and 0 deletions
|
@ -34,11 +34,13 @@ void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id,
|
||||||
|
|
||||||
if (vendor_id != -1 &&
|
if (vendor_id != -1 &&
|
||||||
qpci_config_readw(dev, PCI_VENDOR_ID) != vendor_id) {
|
qpci_config_readw(dev, PCI_VENDOR_ID) != vendor_id) {
|
||||||
|
g_free(dev);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device_id != -1 &&
|
if (device_id != -1 &&
|
||||||
qpci_config_readw(dev, PCI_DEVICE_ID) != device_id) {
|
qpci_config_readw(dev, PCI_DEVICE_ID) != device_id) {
|
||||||
|
g_free(dev);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue