diff options
author | Daniel Veillard <veillard@redhat.com> | 2013-07-22 14:28:20 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2013-07-22 14:28:20 +0800 |
commit | 717042d2ae21e36c5efda8d2e64fc88385095503 (patch) | |
tree | 6e9297691eb309be5e86ee803bc6eea1badaa605 /xmlschemastypes.c | |
parent | ccc9cf9276d9f603f01302da885155556d236b56 (diff) | |
download | android_external_libxml2-717042d2ae21e36c5efda8d2e64fc88385095503.tar.gz android_external_libxml2-717042d2ae21e36c5efda8d2e64fc88385095503.tar.bz2 android_external_libxml2-717042d2ae21e36c5efda8d2e64fc88385095503.zip |
Avoid crash if allocation fails
https://bugzilla.gnome.org/show_bug.cgi?id=704527
xmlSchemaNewValue() may fail on OOM error
Diffstat (limited to 'xmlschemastypes.c')
-rw-r--r-- | xmlschemastypes.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xmlschemastypes.c b/xmlschemastypes.c index a9edc03b..ec403e82 100644 --- a/xmlschemastypes.c +++ b/xmlschemastypes.c @@ -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); } |