提交 03122d7b 编写于 作者: P Peter Krempa

virsh-snapshot: Simplify cleanup path in cmdSnapshotEdit

上级 29882a05
...@@ -567,9 +567,8 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd) ...@@ -567,9 +567,8 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
vshCommandOptBool(cmd, "snapshotname")) vshCommandOptBool(cmd, "snapshotname"))
define_flags |= VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT; define_flags |= VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT;
dom = vshCommandOptDomain(ctl, cmd, NULL); if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
if (dom == NULL) return false;
goto cleanup;
if (vshLookupSnapshot(ctl, cmd, "snapshotname", false, dom, if (vshLookupSnapshot(ctl, cmd, "snapshotname", false, dom,
&snapshot, &name) < 0) &snapshot, &name) < 0)
...@@ -628,8 +627,7 @@ cleanup: ...@@ -628,8 +627,7 @@ cleanup:
virDomainSnapshotFree(edited); virDomainSnapshotFree(edited);
if (snapshot) if (snapshot)
virDomainSnapshotFree(snapshot); virDomainSnapshotFree(snapshot);
if (dom) virDomainFree(dom);
virDomainFree(dom);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册