mirror of https://gitee.com/openkylin/libvirt.git
virsh-snapshot: Simplify cleanup path in cmdSnapshotEdit
This commit is contained in:
parent
29882a054e
commit
03122d7baf
|
@ -567,9 +567,8 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
|
|||
vshCommandOptBool(cmd, "snapshotname"))
|
||||
define_flags |= VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT;
|
||||
|
||||
dom = vshCommandOptDomain(ctl, cmd, NULL);
|
||||
if (dom == NULL)
|
||||
goto cleanup;
|
||||
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
|
||||
return false;
|
||||
|
||||
if (vshLookupSnapshot(ctl, cmd, "snapshotname", false, dom,
|
||||
&snapshot, &name) < 0)
|
||||
|
@ -628,8 +627,7 @@ cleanup:
|
|||
virDomainSnapshotFree(edited);
|
||||
if (snapshot)
|
||||
virDomainSnapshotFree(snapshot);
|
||||
if (dom)
|
||||
virDomainFree(dom);
|
||||
virDomainFree(dom);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue