diff options
author | Daniel Veillard <veillard@redhat.com> | 2014-07-26 21:04:54 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2014-07-26 21:04:54 +0800 |
commit | 42870f46ccf36f83a55fde03344657d360ba0793 (patch) | |
tree | b47a3875f2a4ab7e002a2467bf90755be88fede2 /relaxng.c | |
parent | 2f9b126a5c39bc7ba14384d4f79479ba05c81239 (diff) | |
download | android_external_libxml2-42870f46ccf36f83a55fde03344657d360ba0793.tar.gz android_external_libxml2-42870f46ccf36f83a55fde03344657d360ba0793.tar.bz2 android_external_libxml2-42870f46ccf36f83a55fde03344657d360ba0793.zip |
Add couple of missing Null checks
For https://bugzilla.gnome.org/show_bug.cgi?id=733710
Reported by Gaurav but with slightly different fixes
Diffstat (limited to 'relaxng.c')
-rw-r--r-- | relaxng.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -6652,12 +6652,17 @@ xmlRelaxNGParseDocument(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) ctxt->define = NULL; if (IS_RELAXNG(node, "grammar")) { schema->topgrammar = xmlRelaxNGParseGrammar(ctxt, node->children); + if (schema->topgrammar == NULL) { + xmlRelaxNGFree(schema); + return (NULL); + } } else { xmlRelaxNGGrammarPtr tmp, ret; schema->topgrammar = ret = xmlRelaxNGNewGrammar(ctxt); if (schema->topgrammar == NULL) { - return (schema); + xmlRelaxNGFree(schema); + return (NULL); } /* * Link the new grammar in the tree |