From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAyg1-0003ax-8p for qemu-devel@nongnu.org; Mon, 21 Dec 2015 06:30:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAyg0-0003dR-Dp for qemu-devel@nongnu.org; Mon, 21 Dec 2015 06:30:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAyg0-0003dH-83 for qemu-devel@nongnu.org; Mon, 21 Dec 2015 06:30:52 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id E38F81838 for ; Mon, 21 Dec 2015 11:30:51 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Mon, 21 Dec 2015 12:30:40 +0100 Message-Id: <1450697444-30119-5-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1450697444-30119-1-git-send-email-marcandre.lureau@redhat.com> References: <1450697444-30119-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 4/8] libqos: remove some leaks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau qpci_device_find() returns allocated data, don't leak it. Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/libqos/pci.c | 2 ++ 1 file changed, 2 insertions(+) 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, =20 if (vendor_id !=3D -1 && qpci_config_readw(dev, PCI_VENDOR_ID) !=3D vendor_id) { + g_free(dev); continue; } =20 if (device_id !=3D -1 && qpci_config_readw(dev, PCI_DEVICE_ID) !=3D device_id) { + g_free(dev); continue; } =20 --=20 2.5.0