mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
vsh: cmdEcho: use separate variable for argument
Do not use 'arg' which is later used for an allocated string. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
2cbc686d66
commit
f78e2495e5
@ -3199,17 +3199,16 @@ cmdEcho(vshControl *ctl, const vshCmd *cmd)
|
||||
while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
|
||||
char *str;
|
||||
g_auto(virBuffer) xmlbuf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
arg = opt->data;
|
||||
const char *curr = opt->data;
|
||||
|
||||
if (count)
|
||||
virBufferAddChar(&buf, ' ');
|
||||
|
||||
if (xml) {
|
||||
virBufferEscapeString(&xmlbuf, "%s", arg);
|
||||
virBufferEscapeString(&xmlbuf, "%s", curr);
|
||||
str = virBufferContentAndReset(&xmlbuf);
|
||||
} else {
|
||||
str = g_strdup(arg);
|
||||
str = g_strdup(curr);
|
||||
}
|
||||
|
||||
if (shell)
|
||||
|
Loading…
x
Reference in New Issue
Block a user