mirror of https://gitee.com/openkylin/libvirt.git
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"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
result = virDomainQemuAgentCommand(dom, guest_agent_cmd, timeout, flags);
|
||||
if (!result)
|
||||
goto cleanup;
|
||||
|
||||
if (vshCommandOptBool(cmd, "pretty")) {
|
||||
char *tmp;
|
||||
|
|
Loading…
Reference in New Issue