If the domain can't be looked up, name is used unitialized after the
cleanup label.
Found by coverity.
virDomainPtr dom = NULL;
virDomainSnapshotPtr snapshot = NULL;
virDomainSnapshotPtr edited = NULL;
- const char *name;
+ const char *name = NULL;
const char *edited_name;
bool ret = false;
unsigned int getxml_flags = VIR_DOMAIN_XML_SECURE;
ret = true;
cleanup:
- if (!ret)
+ if (!ret && name)
vshError(ctl, _("Failed to update %s"), name);
if (edited)
virDomainSnapshotFree(edited);