提交 f5c7d889 编写于 作者: J John Ferlan

conf: Alter when ctxt->node is set

In virDomainMemoryDefParseXML and virDomainVideoDefParseXML if
the VIR_ALLOC fails and NULL is returned, then the alteration
to ctxt->node isn't reversed.

Found by Coverity
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 43749000
......@@ -15089,11 +15089,11 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt,
char *vgamem = NULL;
char *primary = NULL;
ctxt->node = node;
if (!(def = virDomainVideoDefNew()))
return NULL;
ctxt->node = node;
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
......@@ -15830,11 +15830,11 @@ virDomainMemoryDefParseXML(virDomainXMLOptionPtr xmlopt,
virDomainMemoryDefPtr def;
int val;
ctxt->node = memdevNode;
if (VIR_ALLOC(def) < 0)
return NULL;
ctxt->node = memdevNode;
if (!(tmp = virXMLPropString(memdevNode, "model"))) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing memory model"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册