提交 e66bdbb7 编写于 作者: E Eric Blake

snapshot: simplify OOM checking during parse

* src/conf/snapshot_conf.c (virDomainSnapshotDefParseString):
Simplify OOM reporting.
上级 a3e95abe
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册