提交 689b64d6 编写于 作者: J Ján Tomko 提交者: Michal Privoznik

virsh: fix uninitialized variable in cmdSnapshotEdit

If the domain can't be looked up, name is used unitialized after the
cleanup label.

Found by coverity.
上级 0c996c10
...@@ -459,7 +459,7 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd) ...@@ -459,7 +459,7 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
virDomainSnapshotPtr snapshot = NULL; virDomainSnapshotPtr snapshot = NULL;
virDomainSnapshotPtr edited = NULL; virDomainSnapshotPtr edited = NULL;
const char *name; const char *name = NULL;
const char *edited_name; const char *edited_name;
bool ret = false; bool ret = false;
unsigned int getxml_flags = VIR_DOMAIN_XML_SECURE; unsigned int getxml_flags = VIR_DOMAIN_XML_SECURE;
...@@ -532,7 +532,7 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd) ...@@ -532,7 +532,7 @@ cmdSnapshotEdit(vshControl *ctl, const vshCmd *cmd)
ret = true; ret = true;
cleanup: cleanup:
if (!ret) if (!ret && name)
vshError(ctl, _("Failed to update %s"), name); vshError(ctl, _("Failed to update %s"), name);
if (edited) if (edited)
virDomainSnapshotFree(edited); virDomainSnapshotFree(edited);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册