mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user