mirror of
https://github.com/darlinghq/darling-libxml2.git
synced 2025-01-31 23:42:01 +00:00
Add couple of missing Null checks
For https://bugzilla.gnome.org/show_bug.cgi?id=733710 Reported by Gaurav but with slightly different fixes
This commit is contained in:
parent
2f9b126a5c
commit
42870f46cc
@ -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
|
||||
|
4
tree.c
4
tree.c
@ -4514,6 +4514,10 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) {
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
if (doc->intSubset != NULL) {
|
||||
ret->intSubset = xmlCopyDtd(doc->intSubset);
|
||||
if (ret->intSubset == NULL) {
|
||||
xmlFreeDoc(ret);
|
||||
return(NULL);
|
||||
}
|
||||
xmlSetTreeDoc((xmlNodePtr)ret->intSubset, ret);
|
||||
ret->intSubset->parent = ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user