From nobody Sun Feb 8 19:56:55 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=1642171263; cv=none; d=zohomail.com; s=zohoarc; b=a4rcoFe1v8XxSWVR/hD2v1LAJ0lH4Zd4K1msUjQXpSR0juseuPyJSZI8gzP8ciQRiF9XmlqyzmWy/14jXWcuXlPD14/P2jc9Qmr9d7OjORzgamgL/X4yX5tWcJkF7d8PL5cTswXP32bkOF8E4r+mBHs4rr4aC73gsSVxmUcMCu8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642171263; 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=3en6brDih5O4rKQ3iNUN4vZNPXO3Qh/+1DRjplSgEaw=; b=T+csIMGzOYyDqg69X8/v+qrhhxA/Et5cPloTkKn2wn2EC23dKWr/aRx1MFN843Un0rYA5yE5osj8QWXyHItS5mo6KuB8bsb1UQAocYOi0i6NEjh5hsQJR/6u+bWz+0MCwS4seaN1wH7cKq09pjA4vnZQDCBl5zu9gUFbNF1KBFM= 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 1642171263669894.3670998927727; Fri, 14 Jan 2022 06:41:03 -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-642-_0mcESMTN2yDvZGOkSWsJw-1; Fri, 14 Jan 2022 09:40:31 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EFB92760CA; Fri, 14 Jan 2022 14:40:25 +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 C862784D22; Fri, 14 Jan 2022 14:40:25 +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 95C321805302; Fri, 14 Jan 2022 14:40:25 +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 20EEeGK6029301 for ; Fri, 14 Jan 2022 09:40:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 380067B6F2; Fri, 14 Jan 2022 14:40:16 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DCE97B6F1 for ; Fri, 14 Jan 2022 14:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642171262; 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=3en6brDih5O4rKQ3iNUN4vZNPXO3Qh/+1DRjplSgEaw=; b=WlGsumDVO1XMS/7xwVZo3XoCHscNVrULXVmFOPNknw+KUg/lDdJMVa3vI5CxCfl/KizA2k Fwg236y+szEwBZBSHz6DLgMoYrvFkean2siodGJ8Vgjxvnx07ztg0hpSJHh4W/lrOsaYY0 a2oJ4pkMmlmf6RuIvrX/9rfO9sFs1m4= X-MC-Unique: _0mcESMTN2yDvZGOkSWsJw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 09/11] xen_xl.c: Use g_autoptr() for virCPUDef Date: Fri, 14 Jan 2022 15:39:53 +0100 Message-Id: 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.79 on 10.5.11.13 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: 1642171265882100001 Content-Type: text/plain; charset="utf-8" In xenParseXLVnuma() the @cpu variable is freed explicitly. However, when switched to g_autoptr(virCPUDef) the explicit call can be removed. Signed-off-by: Michal Privoznik --- src/libxl/xen_xl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 043f3c27db..25bf1f7893 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -396,7 +396,7 @@ xenParseXLVnuma(virConf *conf, size_t vcpus =3D 0; size_t nr_nodes =3D 0; size_t vnodeCnt =3D 0; - virCPUDef *cpu =3D NULL; + g_autoptr(virCPUDef) cpu =3D NULL; virConfValue *list; virConfValue *vnode; virDomainNuma *numa; @@ -529,14 +529,11 @@ xenParseXLVnuma(virConf *conf, } =20 cpu->type =3D VIR_CPU_TYPE_GUEST; - def->cpu =3D cpu; + def->cpu =3D g_steal_pointer(&cpu); =20 ret =3D 0; =20 cleanup: - if (ret) - VIR_FREE(cpu); - return ret; } =20 --=20 2.34.1