mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +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:
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) {
|
||||
@ -4619,8 +4620,8 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd)
|
||||
}
|
||||
|
||||
if (!file) {
|
||||
if (!(file=vshGenFileName(ctl, dom, mime)))
|
||||
return false;
|
||||
if (!(file = vshGenFileName(ctl, dom, mime)))
|
||||
goto cleanup;
|
||||
generated = true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user