mirror of
https://github.com/mii443/qemu.git
synced 2025-09-01 14:49:23 +00: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:
@ -34,11 +34,13 @@ void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id,
|
||||
|
||||
if (vendor_id != -1 &&
|
||||
qpci_config_readw(dev, PCI_VENDOR_ID) != vendor_id) {
|
||||
g_free(dev);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (device_id != -1 &&
|
||||
qpci_config_readw(dev, PCI_DEVICE_ID) != device_id) {
|
||||
g_free(dev);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user