aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libqos/pci.c')
-rw-r--r--tests/libqos/pci.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/libqos/pci.c b/tests/libqos/pci.c
index 4e630c250a..80b1a2117d 100644
--- a/tests/libqos/pci.c
+++ b/tests/libqos/pci.c
@@ -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;
}