From nobody Sun Feb 8 22:06:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1545059195738924.2344098961407; Mon, 17 Dec 2018 07:06:35 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 10A2CC0270B0; Mon, 17 Dec 2018 14:56:03 +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 C77BD50415; Mon, 17 Dec 2018 14:56:02 +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 7238F3F5D7; Mon, 17 Dec 2018 14:56:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBHEtwS2009353 for ; Mon, 17 Dec 2018 09:55:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 859F55D744; Mon, 17 Dec 2018 14:55:58 +0000 (UTC) Received: from unknown54ee7586bd10.attlocal.net.com (ovpn-116-170.phx2.redhat.com [10.3.116.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F1632A2F3 for ; Mon, 17 Dec 2018 14:55:55 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Mon, 17 Dec 2018 09:55:48 -0500 Message-Id: <20181217145548.15125-4-jferlan@redhat.com> In-Reply-To: <20181217145548.15125-1-jferlan@redhat.com> References: <20181217145548.15125-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] remote: Handle xdr char ** data return fields more consistently 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 17 Dec 2018 14:56:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" For consistency, handle the @data "char **" (or remote_string) assignments and processing similarly between various APIs Signed-off-by: John Ferlan --- src/remote/remote_daemon_dispatch.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index 5cefc8480e..fcd602304f 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -1366,7 +1366,6 @@ remoteRelayDomainEventMetadataChange(virConnectPtr co= nn, { daemonClientEventCallbackPtr callback =3D opaque; remote_domain_event_callback_metadata_change_msg data; - char **nsurip; =20 if (callback->callbackID < 0 || !remoteRelayDomainEventCheckACL(callback->client, conn, dom)) @@ -1380,13 +1379,9 @@ remoteRelayDomainEventMetadataChange(virConnectPtr c= onn, =20 data.type =3D type; if (nsuri) { - if (VIR_ALLOC(nsurip) < 0) - return -1; - if (VIR_STRDUP(*nsurip, nsuri) < 0) { - VIR_FREE(nsurip); - return -1; - } - data.nsuri =3D nsurip; + if (VIR_ALLOC(data.nsuri) < 0 || + VIR_STRDUP(*(data.nsuri), nsuri) < 0) + goto error; } =20 if (make_nonnull_domain(&data.dom, dom) < 0) @@ -1432,9 +1427,8 @@ remoteRelayDomainEventBlockThreshold(virConnectPtr co= nn, if (VIR_STRDUP(data.dev, dev) < 0) goto error; if (path) { - if (VIR_ALLOC(data.path) < 0) - goto error; - if (VIR_STRDUP(*(data.path), path) < 0) + if (VIR_ALLOC(data.path) < 0 || + VIR_STRDUP(*(data.path), path) < 0) goto error; } data.threshold =3D threshold; @@ -4006,14 +4000,9 @@ remoteDispatchNodeDeviceGetParent(virNetServerPtr se= rver ATTRIBUTE_UNUSED, ret->parentName =3D NULL; } else { /* remoteDispatchClientRequest will free this. */ - char **parent_p; - if (VIR_ALLOC(parent_p) < 0) + if (VIR_ALLOC(ret->parentName) < 0 || + VIR_STRDUP(*(ret->parentName), parent) < 0) goto cleanup; - if (VIR_STRDUP(*parent_p, parent) < 0) { - VIR_FREE(parent_p); - goto cleanup; - } - ret->parentName =3D parent_p; } =20 rv =3D 0; --=20 2.17.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list