From 07a67fa4bcc1b8bf2651ab41e5fc54a05059cf7e Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Sat, 29 Apr 2006 21:57:40 +0200 Subject: Load /tmp/libxml2-2.6.24 into libxml2/branches/upstream/current. --- schematron.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'schematron.c') diff --git a/schematron.c b/schematron.c index 98184ac..0a90ff8 100644 --- a/schematron.c +++ b/schematron.c @@ -1044,11 +1044,10 @@ done: if (doc != NULL) xmlFreeDoc(doc); } - if (href == NULL) - xmlFree(href); - if (base == NULL) + xmlFree(href); + if (base != NULL) xmlFree(base); - if (URI == NULL) + if (URI != NULL) xmlFree(URI); return(ret); } @@ -1207,13 +1206,15 @@ exit: if (!preserve) { xmlFreeDoc(doc); } - if (ctxt->nberrors != 0) { - xmlSchematronFree(ret); - ret = NULL; - } else { - ret->namespaces = ctxt->namespaces; - ret->nbNamespaces = ctxt->nbNamespaces; - ctxt->namespaces = NULL; + if (ret != NULL) { + if (ctxt->nberrors != 0) { + xmlSchematronFree(ret); + ret = NULL; + } else { + ret->namespaces = ctxt->namespaces; + ret->nbNamespaces = ctxt->nbNamespaces; + ctxt->namespaces = NULL; + } } return (ret); } @@ -1519,7 +1520,7 @@ xmlSchematronNextNode(xmlNodePtr cur) { do { cur = cur->parent; - if (cur == NULL) return(NULL); + if (cur == NULL) break; if (cur->type == XML_DOCUMENT_NODE) return(NULL); if (cur->next != NULL) { cur = cur->next; -- cgit v1.2.3