mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-26 14:03:49 +03:00
tests: qemuMonitorReportError: use tmp variable properly
There is no obvious benefit in putting the escaped message back into msg while tmp holds the original message. Remove the assignment and use 'tmp' directly'. Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
87bd437777
commit
fba29dff83
@ -213,16 +213,14 @@ qemuMonitorReportError(qemuMonitorTestPtr test, const char *errmsg, ...)
|
||||
goto cleanup;
|
||||
|
||||
if (test->agent || test->json) {
|
||||
char *tmp = msg;
|
||||
msg = qemuMonitorEscapeArg(tmp);
|
||||
VIR_FREE(tmp);
|
||||
if (!msg)
|
||||
VIR_AUTOFREE(char *) tmp = NULL;
|
||||
if (!(tmp = qemuMonitorEscapeArg(msg)))
|
||||
goto cleanup;
|
||||
|
||||
if (virAsprintf(&jsonmsg, "{ \"error\": "
|
||||
" { \"desc\": \"%s\", "
|
||||
" \"class\": \"UnexpectedCommand\" } }",
|
||||
msg) < 0)
|
||||
tmp) < 0)
|
||||
goto cleanup;
|
||||
} else {
|
||||
if (virAsprintf(&jsonmsg, "error: '%s'", msg) < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user