From nobody Sun Feb 8 11:06:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1601920134; cv=none; d=zohomail.com; s=zohoarc; b=Cz1KodD7WxWxnUip5O14IVZ5kHzNxeq/ZkPs55+oAt8haPGTvZIxpC++XsshNkv787cqL26iHClaDXubIHGTQ6wJvGqQlBnfm24vdUhED5AKpN06dZn1OYWxzFqcqzIXbUrmbZRnEiPdYETw47xa2hr31AL+H7GCOoMg22lMJ/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601920134; 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=/JIpal2eNq8AjDEi2ORww2ickql3Nf3miOqXC9sBTu8=; b=NEoWWMzyNzev9xxDIXiOOfK3Y6jj7OkTP2NywIoqDW5fROJwimOVz9u8S9F2tZZ6F+kQFvJJJiw0S3QTOhsk83svhT6J9Z1XO9HS4vjiF2vSBQZF1ZvKS7XK0a4LwnDs5YHlabQ3OmsTy5kEdST9ot5tJ+NvYg8VQzYDFAcYEOM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601920134146933.3396847712422; Mon, 5 Oct 2020 10:48:54 -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-216-2kAQMWj-Np-pfVvoNZdCZQ-1; Mon, 05 Oct 2020 13:48:50 -0400 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 1FF7310866A8; Mon, 5 Oct 2020 17:48:45 +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 F0B0E26344; Mon, 5 Oct 2020 17:48:44 +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 BDE7B1826D2F; Mon, 5 Oct 2020 17:48:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 095HmfIq015653 for ; Mon, 5 Oct 2020 13:48:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1593F5C225; Mon, 5 Oct 2020 17:48:41 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91FC05C1C4 for ; Mon, 5 Oct 2020 17:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601920132; 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=/JIpal2eNq8AjDEi2ORww2ickql3Nf3miOqXC9sBTu8=; b=WODpQvRnFp0rWksViJY3zMjH/9OM62Gywggp0Sklh1Cl9xTw+jolMuU9Y5HeftEox4laHf 3wYEOAM8kzTRdA0PiBJCksCPDI/7sQ9TfAKcDeX8TRa5kgH713666bZgA3uzIlUTIiOq/y jFj0MPQmXeJTOoUpQZ70etVlrOOV6Bs= X-MC-Unique: 2kAQMWj-Np-pfVvoNZdCZQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 09/12] util: firewall: use g_new0 Date: Mon, 5 Oct 2020 19:48:24 +0200 Message-Id: <0b2d18a62314a074f237e57f4deff098585b27fb.1601920046.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko --- src/util/virfirewall.c | 9 +++------ src/util/virfirewalld.c | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index 22e717bce4..f6a8beec95 100644 --- a/src/util/virfirewall.c +++ b/src/util/virfirewall.c @@ -211,8 +211,7 @@ virFirewallGroupNew(void) { virFirewallGroupPtr group; =20 - if (VIR_ALLOC(group) < 0) - return NULL; + group =3D g_new0(virFirewallGroup, 1); =20 return group; } @@ -235,8 +234,7 @@ virFirewallPtr virFirewallNew(void) if (virFirewallInitialize() < 0) return NULL; =20 - if (VIR_ALLOC(firewall) < 0) - return NULL; + firewall =3D g_new0(virFirewall, 1); =20 return firewall; } @@ -346,8 +344,7 @@ virFirewallAddRuleFullV(virFirewallPtr firewall, group =3D firewall->groups[firewall->currentGroup]; =20 =20 - if (VIR_ALLOC(rule) < 0) - goto no_memory; + rule =3D g_new0(virFirewallRule, 1); =20 rule->layer =3D layer; rule->queryCB =3D cb; diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c index a94ac7c183..3178bf4b3d 100644 --- a/src/util/virfirewalld.c +++ b/src/util/virfirewalld.c @@ -139,8 +139,7 @@ virFirewallDGetBackend(void) if (!sysbus) return -1; =20 - if (VIR_ALLOC(error) < 0) - return -1; + error =3D g_new0(virError, 1); =20 message =3D g_variant_new("(ss)", "org.fedoraproject.FirewallD1.config", @@ -289,8 +288,7 @@ virFirewallDApplyRule(virFirewallLayer layer, return -1; } =20 - if (VIR_ALLOC(error) < 0) - return -1; + error =3D g_new0(virError, 1); =20 message =3D g_variant_new("(s@as)", ipv, --=20 2.26.2