mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-06 00:43:48 +00:00
virsh-domain: Report errors and don't deref NULL in qemu-agent-command
Check the returned value for NULL and take the cleanup path appropriately if the API fails.
This commit is contained in:
parent
cdd642ba5e
commit
08f1c0a9ae
@ -7739,7 +7739,10 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
|
|||||||
vshError(ctl, "%s", _("timeout, async and block options are exclusive"));
|
vshError(ctl, "%s", _("timeout, async and block options are exclusive"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = virDomainQemuAgentCommand(dom, guest_agent_cmd, timeout, flags);
|
result = virDomainQemuAgentCommand(dom, guest_agent_cmd, timeout, flags);
|
||||||
|
if (!result)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
if (vshCommandOptBool(cmd, "pretty")) {
|
if (vshCommandOptBool(cmd, "pretty")) {
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
Loading…
Reference in New Issue
Block a user