From nobody Sun Feb 8 22:57:49 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=1637601176; cv=none; d=zohomail.com; s=zohoarc; b=a4spy6bw6YcXofqj5GYjDCovDAT8ks1t6EnA5t8onOG+xDDDrOYR/72HFV9o9pXnOezlMLtKHtz6ej6mGHjqYUDdemZZIc5CZ8M69zOhJM06Hi/IGmaUWUcBdY8FjWDNglmqr6ynsOlty7RsXX4rRDjeehQ6siTWQcNUVl/O2hI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637601176; 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=dkm5Odm0IvyV+VqLOMJBuwaoFGqMMxFsjg8dM3jdbWI=; b=Jg9nEDN45i/IbeRTLd+VTOl/g7gbtWCYsr5huo/ForT/X1Ua2EaH6jns7cW3SAakovObCOEEaKSHQIGCn1hA44B7o0wz6sW0dZ3GYm2l6zMiyRSGX3EM+3yx5bDWQzch4dn79nOWzD9cHNKlxRjLQy30HH4Jc8WdYVZhBvb3UR4= 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 1637601176907856.176020442997; Mon, 22 Nov 2021 09:12:56 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-200-dExHiIwsNUGe0uKgTRmy0w-1; Mon, 22 Nov 2021 12:12:52 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0395A881276; Mon, 22 Nov 2021 17:12: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 D493760CC3; Mon, 22 Nov 2021 17:12:42 +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 57D5C4A703; Mon, 22 Nov 2021 17:12:42 +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 1AMHCfCd029317 for ; Mon, 22 Nov 2021 12:12:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7647D60E1C; Mon, 22 Nov 2021 17:12:41 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB4D05C2E3 for ; Mon, 22 Nov 2021 17:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637601175; 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=dkm5Odm0IvyV+VqLOMJBuwaoFGqMMxFsjg8dM3jdbWI=; b=anbWCwL8DP+mWur+nnamS0rzuFNnVxiZ7GpjtTTWsrkcddjEjj0CIVKncgsKNP+oIJSZaY QKfzd2hS0YeNaNzSSTSGkpETX1pE3hHQp6rG/nHKBNnSO8qE+Td7WxBb9XJ5PYJOmL+Hy/ X1JCxLhiIvCx+aY77Tozj53Bkjq3roo= X-MC-Unique: dExHiIwsNUGe0uKgTRmy0w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/12] virSecurityLabelDefParseXML: Use automatic freeing for 'seclabel' Date: Mon, 22 Nov 2021 18:12:25 +0100 Message-Id: <19735464925bb67d0e4edb57e6fe4455bf7007a4.1637600984.git.pkrempa@redhat.com> 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.79 on 10.5.11.12 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: 1637601177891100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index df0d033d0b..99bee98df8 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7802,7 +7802,7 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt, { g_autofree char *model =3D NULL; g_autofree char *relabel =3D NULL; - virSecurityLabelDef *seclabel =3D NULL; + g_autoptr(virSecurityLabelDef) seclabel =3D NULL; model =3D virXMLPropStringLimit(ctxt->node, "model", VIR_SECURITY_MODEL_BUFLEN - 1); @@ -7862,7 +7862,7 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt, /* combination of relabel=3D'yes' and type=3D'static' * is checked a few lines above. */ } - return seclabel; + return g_steal_pointer(&seclabel); } /* Only parse label, if using static labels, or @@ -7899,10 +7899,9 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt, VIR_SECURITY_LABEL_BUFLE= N-1, ctxt); } - return seclabel; + return g_steal_pointer(&seclabel); error: - virSecurityLabelDefFree(seclabel); return NULL; } --=20 2.31.1