1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemuMonitorJSONHumanCommand: Require @reply_str

All callers of qemuMonitorJSONHumanCommand() pass a non-NULL pointer
as @reply_str therefore there's no need to check whether it is NULL.
NB, the sister function (qemuMonitorJSONArbitraryCommand()) doesn't
check for NULL either.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
This commit is contained in:
Michal Privoznik 2021-10-22 10:08:35 +02:00
parent 2d7257d528
commit a70ae22cfd

View File

@ -1470,6 +1470,7 @@ qemuMonitorJSONHumanCommand(qemuMonitor *mon,
virJSONValue *cmd = NULL;
virJSONValue *reply = NULL;
virJSONValue *obj;
const char *data;
int ret = -1;
cmd = qemuMonitorJSONMakeCommand("human-monitor-command",
@ -1490,13 +1491,8 @@ qemuMonitorJSONHumanCommand(qemuMonitor *mon,
goto cleanup;
obj = virJSONValueObjectGet(reply, "return");
if (reply_str) {
const char *data;
data = virJSONValueGetString(obj);
*reply_str = g_strdup(NULLSTR_EMPTY(data));
}
data = virJSONValueGetString(obj);
*reply_str = g_strdup(NULLSTR_EMPTY(data));
ret = 0;