1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-13 20:58:16 +03:00

Avoid crash if allocation fails

https://bugzilla.gnome.org/show_bug.cgi?id=704527
xmlSchemaNewValue() may fail on OOM error
This commit is contained in:
Daniel Veillard 2013-07-22 14:28:20 +08:00
parent ccc9cf9276
commit 717042d2ae

View File

@ -242,6 +242,10 @@ xmlSchemaNewMinLengthFacet(int value)
}
ret->type = XML_SCHEMA_FACET_MINLENGTH;
ret->val = xmlSchemaNewValue(XML_SCHEMAS_NNINTEGER);
if (ret->val == NULL) {
xmlFree(ret);
return(NULL);
}
ret->val->value.decimal.lo = value;
return (ret);
}