From nobody Sun Feb 8 18:32:41 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=1628616486; cv=none; d=zohomail.com; s=zohoarc; b=P31CQMliEdo/bZMy6PoUozhE7v4jsheZgWMoMD/eIsiMT+vSLjmEFHxh9KzP4ZthaOatwjD3yWXE2yWbwQ/QfCcYmL5i2GapMISnfeGT7VaogVZfu8/wZI3HN3fR3Nf1kRMU9EsnNd2HVzHegG9lcDAKyNI9uCKuO95OY/qdY2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628616486; 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=EOF8sSnwizIX1SOxuX1cEvILtTKpKIQG821WXUcDEb8=; b=Rkn8irjgMcWPOxIZSmgpQ+m/TnLMZdiFms1gRMF9SN12fChK6FWwXbY0uGIfx+yJACZqbMOFkJY++Ru38bxfC7LeoSrR/jVa5AmoUKeXUOys1+Zfb5llIIA5w2uRAEZWR+8HarUkJYL9YagopUcCMrdwnlBrePTaFhxOvr79rZk= 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 162861648678651.04163654068418; Tue, 10 Aug 2021 10:28:06 -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-500--zLIdG44OImd2Ww3Asf_6A-1; Tue, 10 Aug 2021 13:28:03 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CC61A1B18BC1; Tue, 10 Aug 2021 17:27:58 +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 A4B522854F; Tue, 10 Aug 2021 17:27:58 +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 70449181A2AA; Tue, 10 Aug 2021 17:27:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17AHEoss021481 for ; Tue, 10 Aug 2021 13:14:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0712C18A77; Tue, 10 Aug 2021 17:14:50 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84DB9136F5 for ; Tue, 10 Aug 2021 17:14:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628616485; 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=EOF8sSnwizIX1SOxuX1cEvILtTKpKIQG821WXUcDEb8=; b=QdRTFpGv1jsJGTUbM7/KafljklM1Xqc60BdOsL/P8guY0p2PMlZO90sejt48nxmeg+/wDJ 3guRxtE6qIaAKdjOI38S9gOUrMTYsnrT4YATmIy7eItzy+M6L5NWzX6zUlTKp2Hqn3BPSz 1n5suVn9YPsU23KohocLUi8xUdc5yUo= X-MC-Unique: -zLIdG44OImd2Ww3Asf_6A-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/5] vsh: cmdEcho: use separate variable for argument Date: Tue, 10 Aug 2021 19:14:40 +0200 Message-Id: <7e0e57a8e1f27c6b838c0fb503d9dbcedcc531da.1628615384.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628616488680100003 Do not use 'arg' which is later used for an allocated string. Signed-off-by: J=C3=A1n Tomko --- tools/vsh.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 3bbaecd2ea..bf32a8dc22 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -3199,17 +3199,16 @@ cmdEcho(vshControl *ctl, const vshCmd *cmd) while ((opt =3D vshCommandOptArgv(ctl, cmd, opt))) { char *str; g_auto(virBuffer) xmlbuf =3D VIR_BUFFER_INITIALIZER; - - arg =3D opt->data; + const char *curr =3D opt->data; =20 if (count) virBufferAddChar(&buf, ' '); =20 if (xml) { - virBufferEscapeString(&xmlbuf, "%s", arg); + virBufferEscapeString(&xmlbuf, "%s", curr); str =3D virBufferContentAndReset(&xmlbuf); } else { - str =3D g_strdup(arg); + str =3D g_strdup(curr); } =20 if (shell) --=20 2.31.1