From nobody Wed Feb 11 02:54:48 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=fail(p=quarantine dis=quarantine) header.from=huawei.com ARC-Seal: i=1; a=rsa-sha256; t=1672997112; cv=none; d=zohomail.com; s=zohoarc; b=MIHQn+CIHPuMD/kLtFz+u9vw2yCDMxEJsj/P5LZBh7eYeG7KDcpevvehBH8KgQnqFQiryeRcvzckRR03j6sPr9400IbnJVfCWBWIp+GuNx/OlzeqI4hKcImj5GAZ28R20wxGBDiTySGPtls7UTwGnFIsdhk+ZBVvaWlFdJIX0oM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672997112; 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=Z/Kh2tvO1x/TxERdbuvECbf1bAVFBYIjwSueu+YJqQg=; b=XNQq+DKTDjiPlQlAjvkEbWSPPtonWqAc91gSVU6Sk9KMCo+zzvi2Yh5+qDuTS7ZaWDL2eux7rQqswhxoSfIwAoz6D393f7q2JiG29e+PZmo9lIjBI32z4kCTc8Haa4mVo+T7WY/UoOMC9DLQdCSHP6QydeNzj3EIeZQLseu6yCA= 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=fail header.from= (p=quarantine dis=quarantine) 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 1672997112273972.9083061770107; Fri, 6 Jan 2023 01:25:12 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-648-JGjOH9reO2e-uS-uXaPSTQ-1; Fri, 06 Jan 2023 04:25:06 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9FB9385C092; Fri, 6 Jan 2023 09:25:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8330E400E40A; Fri, 6 Jan 2023 09:25:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7801019465A8; Fri, 6 Jan 2023 09:25:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 58AFA19465B3 for ; Fri, 6 Jan 2023 09:25:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4C8D24014CE6; Fri, 6 Jan 2023 09:25:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44BE140C945A for ; Fri, 6 Jan 2023 09:25:00 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B3D2101A52E for ; Fri, 6 Jan 2023 09:25:00 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-76-3QELjk5oMbmZ_iQOo4HVow-1; Fri, 06 Jan 2023 04:24:58 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NpHvL2SYsz16MY0 for ; Fri, 6 Jan 2023 17:23:26 +0800 (CST) Received: from localhost.localdomain (10.175.124.27) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 6 Jan 2023 17:24:54 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672997111; 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=Z/Kh2tvO1x/TxERdbuvECbf1bAVFBYIjwSueu+YJqQg=; b=X6J718PzaoLG+fePrwlVqbe1BW27bKfa1yDCq5ezONyPJZ/HUIQqQ+L0s5Mdc3nvzZxdqx swqW/ymIROa/Ltdc6qQzDxOnckUNbluhiFr6HRCeQYJrJKTIR/3j+jbNPvw9Ob1ZTEW7rm ZYlAgK/lFM3FBodU6zMIQsIJB1dzUVM= X-MC-Unique: JGjOH9reO2e-uS-uXaPSTQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 3QELjk5oMbmZ_iQOo4HVow-1 From: Jiang Jiacheng To: Subject: [PATCH 4/9] remote: use g_autofree and remove unnecessary label Date: Fri, 6 Jan 2023 17:18:34 +0800 Message-ID: <20230106091839.1263372-5-jiangjiacheng@huawei.com> In-Reply-To: <20230106091839.1263372-1-jiangjiacheng@huawei.com> References: <20230106091839.1263372-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500022.china.huawei.com (7.185.36.66) X-CFilter-Loop: Reflected X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yubihong@huawei.com, zhengchuan@huawei.com, linyilu@huawei.com, jiangjiacheng@huawei.com, xiexiangyou@huawei.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: 1672997112719100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiang Jiacheng --- src/remote/remote_driver.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index b0dba9057b..316a11b10f 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -3833,23 +3833,19 @@ struct remoteAuthInteractState { static int remoteAuthFillFromConfig(virConnectPtr conn, struct remoteAuthInteractState *state) { - int ret =3D -1; int ninteract; const char *credname; - char *path =3D NULL; + g_autofree char *path =3D NULL; =20 VIR_DEBUG("Trying to fill auth parameters from config file"); =20 if (!state->config) { if (virAuthGetConfigFilePath(conn, &path) < 0) - goto cleanup; - if (path =3D=3D NULL) { - ret =3D 0; - goto cleanup; - } - + return -1; + if (path =3D=3D NULL) + return 0; if (!(state->config =3D virAuthConfigNew(path))) - goto cleanup; + return -1; } =20 for (ninteract =3D 0; state->interact[ninteract].id !=3D 0; ninteract+= +) { @@ -3879,7 +3875,7 @@ static int remoteAuthFillFromConfig(virConnectPtr con= n, VIR_URI_SERVER(conn->uri), credname, &value) < 0) - goto cleanup; + return -1; =20 if (value) { state->interact[ninteract].result =3D value; @@ -3887,11 +3883,7 @@ static int remoteAuthFillFromConfig(virConnectPtr co= nn, } } =20 - ret =3D 0; - - cleanup: - VIR_FREE(path); - return ret; + return 0; } =20 =20 --=20 2.33.0