From patchwork Tue Feb 2 12:43:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 577130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4A287140AD9 for ; Tue, 2 Feb 2016 23:46:33 +1100 (AEDT) Received: from localhost ([::1]:56668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQaLn-00015Q-Ck for incoming@patchwork.ozlabs.org; Tue, 02 Feb 2016 07:46:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQaJ7-0004z0-Sz for qemu-devel@nongnu.org; Tue, 02 Feb 2016 07:43:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQaJ7-0001zh-2P for qemu-devel@nongnu.org; Tue, 02 Feb 2016 07:43:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47250) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQaJ6-0001zH-TZ for qemu-devel@nongnu.org; Tue, 02 Feb 2016 07:43:45 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 847717AEAE; Tue, 2 Feb 2016 12:43:44 +0000 (UTC) Received: from localhost (ovpn-113-82.phx2.redhat.com [10.3.113.82]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u12Chh0q028981; Tue, 2 Feb 2016 07:43:43 -0500 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Date: Tue, 2 Feb 2016 13:43:32 +0100 Message-Id: <1454417016-3913-5-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1454417016-3913-1-git-send-email-marcandre.lureau@redhat.com> References: <1454417016-3913-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: claudio.fontana@huawei.com, armbru@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [Qemu-devel] [PULL 4/8] libqos: remove some leaks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau 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(+) 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; }