From nobody Tue Feb 10 13:01:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593056230; cv=none; d=zohomail.com; s=zohoarc; b=adaZIgE5QVYpxGqbUjc/3mGA0Vwz5uC5A3DWX5+0nwumfaeYZsJ2kywn1fpIv7bexN2hZbErqC9e2z2vcJ2HRdPFsiZJZVhdfkb8hbcKs6Om0Jq0qxPRgerZj2KfV63SRm9S0YXbts784GH8bbR4/ZGvjYyTL70SLDAMGs/v6+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593056230; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/Eq9TihiAfZUMDyfhxCDxCYvyX/lCntZwgWQjry+C/M=; b=bT14follYevGM8UV/hMXQCif4aRP2+TXc4rLD2V+G1ivgfJo0S9E3yP2Uo/wAP+hAoiF/nHyJgQZAdorhgKXtqQkV+ttVgZ3ruwSFf0+FVadR67lno0NAfV0mKlRM/TXs4cBy1NNKReMlpGUYf9kaHHTgzlDlNTfoDbMWa1L+mE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1593056230056928.3140889738111; Wed, 24 Jun 2020 20:37:10 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-304-27f3feEOORKyz2jt2sECjg-1; Wed, 24 Jun 2020 23:34:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 32C51EC1A7; Thu, 25 Jun 2020 03:34:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0B2AC4F6AE; Thu, 25 Jun 2020 03:34:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A869F875AE; Thu, 25 Jun 2020 03:34:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05P3YXD0007926 for ; Wed, 24 Jun 2020 23:34:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id E2C7D5BAC9; Thu, 25 Jun 2020 03:34:33 +0000 (UTC) Received: from vhost2.laine.org (ovpn-114-28.phx2.redhat.com [10.3.114.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EBAD5BAC6 for ; Thu, 25 Jun 2020 03:34:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593056228; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/Eq9TihiAfZUMDyfhxCDxCYvyX/lCntZwgWQjry+C/M=; b=PbmzUKWuZx3Vzbbuc0Cu1EyqY5I+xg0OXM4u8R3mDvlKKAwWCwkJb+9uK1vMFGei3e5qkh h+vBqOCFXX+0jdSBeAX3wXyN+v9ERFwAGsc3/Lhhzg5Yzyy99yk6nUyRHu7L4sA/dOFew1 GQyn0FpL6lHPgdh4+uT2Q5bOdr+Qbx0= X-MC-Unique: 27f3feEOORKyz2jt2sECjg-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 20/25] nwfilter: remove unnecessary code from ebtablesGetSubChainInsts() Date: Wed, 24 Jun 2020 23:34:09 -0400 Message-Id: <20200625033414.1819594-21-laine@redhat.com> In-Reply-To: <20200625033414.1819594-1-laine@redhat.com> References: <20200625033414.1819594-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" On failure, this function would clear out and free the list of subchains it had been called with. This is unnecessary, because the *only* caller of this function will also clear out and free the list of subchains if it gets a failure from ebtablesGetSubChainInsts(). (It also makes more logical sense for the function that is creating the entire list to be the one freeing the entire list, rather than having a function whose purpose is only to create *one item* on the list freeing the entire list). Signed-off-by: Laine Stump --- src/nwfilter/nwfilter_ebiptables_driver.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfil= ter_ebiptables_driver.c index 89c131e17f..8fdc8e8897 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -3334,12 +3334,6 @@ ebtablesGetSubChainInsts(virHashTablePtr chains, =20 cleanup: VIR_FREE(filter_names); - if (ret < 0) { - for (i =3D 0; i < *ninsts; i++) - VIR_FREE(*insts[i]); - VIR_FREE(*insts); - *ninsts =3D 0; - } return ret; =20 } --=20 2.25.4