From nobody Fri Dec 19 22:05:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1744632193281962.429515462659; Mon, 14 Apr 2025 05:03:13 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 73D4F14F8; Mon, 14 Apr 2025 08:03:12 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id EFC6B1519; Mon, 14 Apr 2025 08:02:56 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8E61E14EA; Mon, 14 Apr 2025 08:02:53 -0400 (EDT) Received: from air.basealt.ru (air.basealt.ru [193.43.8.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 893AB14E3 for ; Mon, 14 Apr 2025 08:02:52 -0400 (EDT) Received: from kuznetsovam-nb.office.basealt.ru (unknown [193.43.10.250]) (Authenticated sender: kuznetsovam) by air.basealt.ru (Postfix) with ESMTPSA id 05233233A6; Mon, 14 Apr 2025 15:02:51 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 From: Alexander Kuznetsov To: devel@lists.libvirt.org Subject: [PATCH] virNWFilterIncludeDefToRuleInst: Prevent potential double g_free Date: Mon, 14 Apr 2025 15:02:35 +0300 Message-ID: <20250414120237.22669-1-kuznetsovam@altlinux.org> X-Mailer: git-send-email 2.42.4 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FDSKUVKIV4WRASFURG2DF53NIUZZMOY7 X-Message-ID-Hash: FDSKUVKIV4WRASFURG2DF53NIUZZMOY7 X-MailFrom: kuznetsovam@altlinux.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: nickel@altlinux.org, egori@altlinux.org X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZM-MESSAGEID: 1744632197144019100 Content-Type: text/plain; charset="utf-8" If virNWFilterDefToInst returns -1, it has already called virNWFilterInstRe= set. Remove the additional call to prevent a double g_free Found by Linux Verification Center (linuxtesting.org) with Svace. Reported-by: Dmitry Fedin Signed-off-by: Alexander Kuznetsov --- src/nwfilter/nwfilter_gentech_driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter= _gentech_driver.c index 41f270bb7c..f7a909bdc0 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -293,10 +293,8 @@ virNWFilterIncludeDefToRuleInst(virNWFilterDriverState= *driver, tmpvars, useNewFilter, foundNewFilter, - inst) < 0) { - virNWFilterInstReset(inst); + inst) < 0) return -1; - } =20 return 0; } --=20 2.42.4