mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
snapshot: simplify OOM checking during parse
* src/conf/snapshot_conf.c (virDomainSnapshotDefParseString): Simplify OOM reporting.
This commit is contained in:
parent
a3e95abeb5
commit
e66bdbb784
@ -208,15 +208,11 @@ virDomainSnapshotDefParseString(const char *xmlStr,
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("a redefined snapshot must have a name"));
|
||||
goto cleanup;
|
||||
} else {
|
||||
ignore_value(virAsprintf(&def->name, "%lld",
|
||||
(long long)tv.tv_sec));
|
||||
}
|
||||
}
|
||||
|
||||
if (def->name == NULL) {
|
||||
virReportOOMError();
|
||||
goto cleanup;
|
||||
if (virAsprintf(&def->name, "%lld", (long long)tv.tv_sec) < 0) {
|
||||
virReportOOMError();
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
def->description = virXPathString("string(./description)", ctxt);
|
||||
|
Loading…
Reference in New Issue
Block a user