From: Peter Krempa Date: Mon, 3 Jun 2013 13:42:26 +0000 (+0200) Subject: virsh-domain: Report errors and don't deref NULL in qemu-agent-command X-Git-Tag: v1.1.0-rc1~156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08f1c0a9ae175968ac5c64564e6ba4fa6fa037ae;p=thirdparty%2Flibvirt.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. --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 46f07edc72..9ea5ffc97e 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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;