From nobody Wed Dec 17 07:32:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1614768371; cv=none; d=zohomail.com; s=zohoarc; b=E7IQ9YrCjwVf3UkGjtF4WTQISBzI2ixYSG6JtG/p7nFE7WsQy+izy33PWqR6CQWWI4oAHDcwSFkAunEQtcfNOh/YkjZfIIB8IUfqsd27T+hbkxkx4HT0l3+6yqeaFHzUeYTTnJEijRneFjEBNm2Go9LhdCx8qyfhBKFybIRzAyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614768371; 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=z/Y413NUB7esD9gZC5mebazwA+djRgLykn7ud5bpiIk=; b=OJ5v1hYw6+2vMAKi1q2QnaqzHiqyNcpCTtXtlxqgpH9F7SnHg/J0bZquf9125tiVSEb6IzEMEcKRfrBQc2ZMXI+d9SJTGPi1uZDOHjYdFU8tl+HWBo5/w9Qh0GW/Id5nEIGZmJ4S5uQFhJ28It7phbssbxVFnGb9Q2qBJHhLXjk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1614768371019274.9959181307273; Wed, 3 Mar 2021 02:46:11 -0800 (PST) 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-232-qEd-vb-6P8OVzw3rMQqLRA-1; Wed, 03 Mar 2021 05:46:07 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A4E01DE0A; Wed, 3 Mar 2021 10:46:02 +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 D336110013DB; Wed, 3 Mar 2021 10:46:01 +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 8C3691809C8F; Wed, 3 Mar 2021 10:46:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 123Ajj5h027940 for ; Wed, 3 Mar 2021 05:45:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 69C2869323; Wed, 3 Mar 2021 10:45:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id C92215D768 for ; Wed, 3 Mar 2021 10:45:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614768370; 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=z/Y413NUB7esD9gZC5mebazwA+djRgLykn7ud5bpiIk=; b=BnYlw6Ule6WajRSXKhGAmId32O9CC/wwgRfU4KyU2hjtsETLJSPLMF34lEzk0mqb9hOiuy fK1KeTCZB85GWUvk/SU7Rkwdaixhv/GhoICDXG4P4vgFtBUReXXOjiC7IGa7cNWht3Hm2u Ctg70oPd8yFizIgoJF6i9Ow5O6HJD+8= X-MC-Unique: qEd-vb-6P8OVzw3rMQqLRA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/5] remote_daemon_dispatch: Replace g_new + strcpy with g_strdup Date: Wed, 3 Mar 2021 11:45:35 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.84 on 10.5.11.22 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: Peter Krempa --- src/remote/remote_daemon_dispatch.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index e9f2a0ce5b..9700dba450 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -2647,8 +2647,7 @@ remoteDispatchDomainGetSecurityLabel(virNetServerPtr = server G_GNUC_UNUSED, goto cleanup; ret->label.label_len =3D strlen(seclabel->label) + 1; - ret->label.label_val =3D g_new0(char, ret->label.label_len); - strcpy(ret->label.label_val, seclabel->label); + ret->label.label_val =3D g_strdup(seclabel->label); ret->enforcing =3D seclabel->enforcing; rv =3D 0; @@ -2729,12 +2728,10 @@ remoteDispatchNodeGetSecurityModel(virNetServerPtr = server G_GNUC_UNUSED, goto cleanup; ret->model.model_len =3D strlen(secmodel.model) + 1; - ret->model.model_val =3D g_new0(char, ret->model.model_len); - strcpy(ret->model.model_val, secmodel.model); + ret->model.model_val =3D g_strdup(secmodel.model); ret->doi.doi_len =3D strlen(secmodel.doi) + 1; - ret->doi.doi_val =3D g_new0(char, ret->doi.doi_len); - strcpy(ret->doi.doi_val, secmodel.doi); + ret->doi.doi_val =3D g_strdup(secmodel.doi); rv =3D 0; --=20 2.29.2