remove a memory leak on schemas type facets. reduce verbosity incorporated
* relaxng.c: remove a memory leak on schemas type facets.
* check-relaxng-test-suite.py check-relaxng-test-suite2.py
check-xsddata-test-suite.py: reduce verbosity
* configure.in Makefile.am: incorporated the Python regressions
tests for Relax-NG and Schemas Datatype to "make tests"
Daniel
diff --git a/relaxng.c b/relaxng.c
index 9292497..1fd46e9 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -2501,7 +2501,7 @@
xmlSchemaFreeFacet(facet);
return (-1);
}
- facet->value = xmlStrdup(val);
+ facet->value = val;
ret = xmlSchemaCheckFacet(facet, typ, NULL, type);
if (ret != 0) {
xmlSchemaFreeFacet(facet);
@@ -6871,6 +6871,7 @@
xmlChar *href, *ns, *base, *URL;
xmlRelaxNGDocumentPtr docu;
xmlNodePtr tmp;
+ xmlURIPtr uri;
ns = xmlGetProp(cur, BAD_CAST "ns");
if (ns == NULL) {
@@ -6891,6 +6892,27 @@
delete = cur;
goto skip_children;
}
+ uri = xmlParseURI((const char *) href);
+ if (uri == NULL) {
+ xmlRngPErr(ctxt, cur, XML_RNGP_HREF_ERROR,
+ "Incorrect URI for externalRef %s\n",
+ href, NULL);
+ if (href != NULL)
+ xmlFree(href);
+ delete = cur;
+ goto skip_children;
+ }
+ if (uri->fragment != NULL) {
+ xmlRngPErr(ctxt, cur, XML_RNGP_HREF_ERROR,
+ "Fragment forbidden in URI for externalRef %s\n",
+ href, NULL);
+ xmlFreeURI(uri);
+ if (href != NULL)
+ xmlFree(href);
+ delete = cur;
+ goto skip_children;
+ }
+ xmlFreeURI(uri);
base = xmlNodeGetBase(cur->doc, cur);
URL = xmlBuildURI(href, base);
if (URL == NULL) {