summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2015-12-18 15:13:32 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:30:22 -0600
commit6356f95453742b8732b82bd419cb88d0e72cdc21 (patch)
tree0a48a937614d22b5d9f256d62d9802cfd88ec1d7
parentc3f8e9c283f058446879a6bc46f8f25d361bfaac (diff)
downloadhqemu-6356f95453742b8732b82bd419cb88d0e72cdc21.zip
hqemu-6356f95453742b8732b82bd419cb88d0e72cdc21.tar.gz
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>
-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 4e630c2..80b1a21 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;
}
OpenPOWER on IntegriCloud