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

virsh-domain: Add a missing check and fix leak in cmdScreenshot

Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Hongwei Bi 2013-09-25 22:54:24 +08:00 committed by Eric Blake
parent 0377238fe8
commit b80fff1444

@ -4610,7 +4610,8 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd)
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
return false;
st = virStreamNew(ctl->conn, 0);
if (!(st = virStreamNew(ctl->conn, 0)))
goto cleanup;
mime = virDomainScreenshot(dom, st, screen, flags);
if (!mime) {
@ -4620,7 +4621,7 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd)
if (!file) {
if (!(file = vshGenFileName(ctl, dom, mime)))
return false;
goto cleanup;
generated = true;
}