From nobody Tue Feb 10 05:44:33 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=1577973547; cv=none; d=zohomail.com; s=zohoarc; b=JGueRxoZLJSvGa1Y6JThdi4gFA5b4NrpRSKsQbiIMpnxDM5w2IgCqesCODn1XkqGZ2GMpILREG2wzIMWNkEFuuwscELg9b2Cq9jdY3/MazoL6yAc1z1fMiWYDD+cX5UCB1Bt9Ne9mA31+0iUVzmpRZJFlh1b4pBQ2zvTZbdzxlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577973547; h=Content-Type:Content-Transfer-Encoding:Cc: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=YrBamX8RwjxBIRrZbAgD9oGmfe9R8b1sFuEyR/jihxo=; b=ljJApLDXQRBFMAFEjDLjFKGyRsRK8711FywYBYT6df/L4EULegt1FGKoPGnjfJDrrDzcbVRTKmXL6TvfeChEPrGIXlzPvnDPWr4OWxfPx0UBbpli2sM3SsH+BdkWcOlnMOlDKWr4shpmkJqR4ksgpvbA5/VI0QMq/gy+Q03s7Qs= 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 1577973547017171.92116345234695; Thu, 2 Jan 2020 05:59:07 -0800 (PST) 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-285-XIUt7ljhO1CQ9JJLzbNU_g-1; Thu, 02 Jan 2020 08:58:38 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42DD4800594; Thu, 2 Jan 2020 13:58:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1BC2619C5B; Thu, 2 Jan 2020 13:58:31 +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 CC4C618089D0; Thu, 2 Jan 2020 13:58:30 +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 002DwAsG002303 for ; Thu, 2 Jan 2020 08:58:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8EA187A057; Thu, 2 Jan 2020 13:58:10 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id E33597039B; Thu, 2 Jan 2020 13:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577973542; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=YrBamX8RwjxBIRrZbAgD9oGmfe9R8b1sFuEyR/jihxo=; b=dB14OjXhGUK94ORrTGdB3ON1BIGjxHG2w8Kt1fKaOWt5zVWF+D4i9TEuCYj6OA8diH1AMY SMA5rXAz13OPhTcDXh/ipzE2XQ3UbL7qMQ/lLVkVcDvTS7NkKR2EbidLtsl4uYb7m5vSRC HZcngmQh+4kIM068CzmCSNzuLoTBPuU= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 2 Jan 2020 14:57:55 +0100 Message-Id: <20200102135758.848454-5-fidencio@redhat.com> In-Reply-To: <20200102135758.848454-1-fidencio@redhat.com> References: <20200102135758.848454-1-fidencio@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Subject: [libvirt] [PATCH 4/7] util: Use g_auto in virFirewallStartTransaction() 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.84 on 10.5.11.23 X-MC-Unique: XIUt7ljhO1CQ9JJLzbNU_g-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Fabiano Fid=C3=AAncio --- src/util/virfirewall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index d6fff31318..6dace18bc4 100644 --- a/src/util/virfirewall.c +++ b/src/util/virfirewall.c @@ -278,6 +278,7 @@ virFirewallGroupFree(virFirewallGroupPtr group) VIR_FREE(group); } =20 +G_DEFINE_AUTO_CLEANUP_FREE_FUNC(virFirewallGroupPtr, virFirewallGroupFree,= NULL); =20 /** * virFirewallFree: @@ -575,7 +576,7 @@ size_t virFirewallRuleGetArgCount(virFirewallRulePtr ru= le) void virFirewallStartTransaction(virFirewallPtr firewall, unsigned int flags) { - virFirewallGroupPtr group; + g_auto(virFirewallGroupPtr) group =3D NULL; =20 VIR_FIREWALL_RETURN_IF_ERROR(firewall); =20 @@ -586,10 +587,9 @@ void virFirewallStartTransaction(virFirewallPtr firewa= ll, =20 if (VIR_EXPAND_N(firewall->groups, firewall->ngroups, 1) < 0) { - virFirewallGroupFree(group); return; } - firewall->groups[firewall->ngroups - 1] =3D group; + firewall->groups[firewall->ngroups - 1] =3D g_steal_pointer(&group); firewall->currentGroup =3D firewall->ngroups - 1; } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list