From nobody Sun Feb 8 14:31:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1636730575; cv=none; d=zohomail.com; s=zohoarc; b=eUulhgoFGtgzFqpKNHuVssTgAu+VAx+Yjl9BIXRs22ukQ8emBYXreYRKJwexMbo4it+pTP8Nc7h11HF36a1G3qisOz0D6mbjhnZifNrG4k4W0LBgiHg+e0a9nK0nwPr9p5muDT7p1AtNiApR+txizTtD5/+iQwrkw42TemO+wZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636730575; 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=+PlLVj9IJrwlhJ7bsMPHIvq42R9XishmtBsgE2ZYUow=; b=MDi3oDbDD30L0hI6kuzO2et/cFyx3QLiiee806y8swPU96ao/i8Sy1lqaHAwbxxGN6++kYu10IQDapNXYDSPHjPvdLJ1ZHO+CPx6iC96hLb9ZWT1yniRoeyAFBiBnAhjYSDD/wJ/cXjy0WA9cv4bVLXbYVWSUsWLOWLXggSVSlY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1636730574730625.7160977482278; Fri, 12 Nov 2021 07:22:54 -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-96-pDAGm4IvOg63ECkPEFkfRQ-1; Fri, 12 Nov 2021 10:22:51 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3CE2425C8; Fri, 12 Nov 2021 15:22:46 +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 5E8211002391; Fri, 12 Nov 2021 15:22:46 +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 D80D74E9F5; Fri, 12 Nov 2021 15:22:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1ACFMh4u014361 for ; Fri, 12 Nov 2021 10:22:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7871D60C4A; Fri, 12 Nov 2021 15:22:43 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id F33D760C17 for ; Fri, 12 Nov 2021 15:22:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636730573; 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=+PlLVj9IJrwlhJ7bsMPHIvq42R9XishmtBsgE2ZYUow=; b=W+dVAjvJlHCHFYZF7L04PKsgvurbZ2mi19hbejFhGb/w8j0WpTrlRUnVoi+d28dnN4CYGZ w51Gp71D/5NQ1PyQYkDz0BHmb+Ftxy2Rd5Dho6oBRbM++N2g0A3joG8HHXr4ePItHvTU8X gerY6gd1gGpo4uFyvUBPGQWk8jbSZ/E= X-MC-Unique: pDAGm4IvOg63ECkPEFkfRQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/4] virNetDevVPortProfileParse: Use g_autofree Date: Fri, 12 Nov 2021 16:22:32 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.22 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1636730577130100001 Content-Type: text/plain; charset="utf-8" Explicit calls to VIR_FREE() can be dropped then. Signed-off-by: Michal Privoznik --- src/conf/netdev_vport_profile_conf.c | 30 ++++++++++------------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_p= rofile_conf.c index d98ce098df..dfffc4dd70 100644 --- a/src/conf/netdev_vport_profile_conf.c +++ b/src/conf/netdev_vport_profile_conf.c @@ -29,14 +29,14 @@ virNetDevVPortProfile * virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags) { - char *virtPortType; - char *virtPortManagerID =3D NULL; - char *virtPortTypeID =3D NULL; - char *virtPortTypeIDVersion =3D NULL; - char *virtPortInstanceID =3D NULL; - char *virtPortProfileID =3D NULL; - char *virtPortInterfaceID =3D NULL; - virNetDevVPortProfile *virtPort =3D NULL; + g_autofree char *virtPortType =3D NULL; + g_autofree char *virtPortManagerID =3D NULL; + g_autofree char *virtPortTypeID =3D NULL; + g_autofree char *virtPortTypeIDVersion =3D NULL; + g_autofree char *virtPortInstanceID =3D NULL; + g_autofree char *virtPortProfileID =3D NULL; + g_autofree char *virtPortInterfaceID =3D NULL; + g_autofree virNetDevVPortProfile *virtPort =3D NULL; xmlNodePtr cur =3D node->children; =20 virtPort =3D g_new0(virNetDevVPortProfile, 1); @@ -178,20 +178,10 @@ virNetDevVPortProfileParse(xmlNodePtr node, unsigned = int flags) if (virNetDevVPortProfileCheckNoExtras(virtPort) < 0) goto error; =20 - cleanup: - VIR_FREE(virtPortManagerID); - VIR_FREE(virtPortTypeID); - VIR_FREE(virtPortTypeIDVersion); - VIR_FREE(virtPortInstanceID); - VIR_FREE(virtPortProfileID); - VIR_FREE(virtPortType); - VIR_FREE(virtPortInterfaceID); - - return virtPort; + return g_steal_pointer(&virtPort); =20 error: - VIR_FREE(virtPort); - goto cleanup; + return NULL; } =20 =20 --=20 2.32.0