From ea53854a54bc54dddeec0c56572adf53384e960c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 18 Dec 2015 15:13:32 +0100 Subject: libqos: remove some leaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qpci_device_find() returns allocated data, don't leak it. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- tests/libqos/pci.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/libqos/pci.c') 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; } -- cgit v1.2.3