From nobody Sat Feb 7 07:10:30 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=1621433743; cv=none; d=zohomail.com; s=zohoarc; b=WLKxdeSJSKTuFdQ1ePHhPsEwnJYnXpEjYu5W0bhaysqT78y6tToZ8pOlltf/jTCCvr2/WrOvuQDHOX0xMtieAWEwne8GrpsUVIw/TX2UL9N5c1rDrpsRJZObYpY1NWeyMb3OJPcM2YjwKNqzi8mGPnsz7RYsMy+oL8R7J1OjYAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621433743; 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=rxpWSLS9o6V4UYLEcAL4vEHoeKbQ7hhqW8TjlrMKLWc=; b=adXx70B2ySOcx7bbm2GVoXk6hNNqNv3Yl0fikxfzEwKnUSAynsMAlLcZ2rRopUJP4p8zFn+t+DkFnwTL+Du6cSiFl0mo50xS2jkaBdvqrwbhRVJ6zkUqK1eXbUcWdfxvW5KDlYeiIwmdSCOFC2D7n0lcyhNU7fvmuQKjIUqtmzw= 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) header.from= 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 1621433743681865.9263431989416; Wed, 19 May 2021 07:15:43 -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-226-f_yJrC3OM_izC9zazUvBHw-1; Wed, 19 May 2021 10:15:38 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CCC806416B; Wed, 19 May 2021 14:15:33 +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 7DAB55C1D0; Wed, 19 May 2021 14:15: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 25D1189A3; Wed, 19 May 2021 14:15:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14JEAOwl011880 for ; Wed, 19 May 2021 10:10:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 797D71037EB5; Wed, 19 May 2021 14:10:24 +0000 (UTC) Received: from work.redhat.com (ovpn-113-53.ams2.redhat.com [10.36.113.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB4AE10013C1; Wed, 19 May 2021 14:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621433740; 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=rxpWSLS9o6V4UYLEcAL4vEHoeKbQ7hhqW8TjlrMKLWc=; b=YUUVCsujCIotIogr9fQzoqLawkNPBlKqmoFlDJObDXSrMvcUkYLBtshpj6H70Mo4+YT2fW +7KrRA51CaPkEXk5mbyG0pB2gEPalP5P8f7XNfrOle6kY3mOVCNL8N1KsK3prcX9vY7lQY 0VN+zM2YPoZWqd3R1J7ZDYjC3zoGyK4= X-MC-Unique: f_yJrC3OM_izC9zazUvBHw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/10] virStorageAdapterParseXML: Use g_autofree Date: Wed, 19 May 2021 16:10:09 +0200 Message-Id: <20210519141012.125114-8-twiederh@redhat.com> In-Reply-To: <20210519141012.125114-1-twiederh@redhat.com> References: <20210519141012.125114-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.16 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) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/conf/storage_adapter_conf.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/conf/storage_adapter_conf.c b/src/conf/storage_adapter_con= f.c index 6b5a58e1e7..717d00dc4a 100644 --- a/src/conf/storage_adapter_conf.c +++ b/src/conf/storage_adapter_conf.c @@ -168,9 +168,8 @@ virStorageAdapterParseXML(virStorageAdapter *adapter, xmlNodePtr node, xmlXPathContextPtr ctxt) { - int ret =3D -1; VIR_XPATH_NODE_AUTORESTORE(ctxt) - char *adapter_type =3D NULL; + g_autofree char *adapter_type =3D NULL; =20 ctxt->node =3D node; =20 @@ -180,27 +179,23 @@ virStorageAdapterParseXML(virStorageAdapter *adapter, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unknown pool adapter type '%s'"), adapter_type); - goto cleanup; + return -1; } =20 if ((adapter->type =3D=3D VIR_STORAGE_ADAPTER_TYPE_FC_HOST) && (virStorageAdapterParseXMLFCHost(node, &adapter->data.fchost))= < 0) - goto cleanup; + return -1; =20 if ((adapter->type =3D=3D VIR_STORAGE_ADAPTER_TYPE_SCSI_HOST) && (virStorageAdapterParseXMLSCSIHost(node, ctxt, &adapter->data.scsi_host)) = < 0) - goto cleanup; + return -1; } else { if (virStorageAdapterParseXMLLegacy(node, ctxt, adapter) < 0) - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - VIR_FREE(adapter_type); - return ret; + return 0; } =20 =20 --=20 2.26.3