fixed xmlSetProp and al. when the node passed is not an element. fixed
* tree.c: fixed xmlSetProp and al. when the node passed is not an
element.
* relaxng.c: fixed bugs 7.3 (though not complete) and memory leaks
found 373 test schemas: 369 success 4 failures
found 529 test instances: 525 success 4 failures
* check-relaxng-test-suite.py: added memory debug reporting
Daniel
diff --git a/tree.c b/tree.c
index 7fc306c..1a03a5a 100644
--- a/tree.c
+++ b/tree.c
@@ -1402,6 +1402,8 @@
#endif
return(NULL);
}
+ if ((node != NULL) && (node->type != XML_ELEMENT_NODE))
+ return(NULL);
/*
* Allocate a new property and fill the fields.
@@ -5699,7 +5701,7 @@
xmlAttrPtr prop;
xmlDocPtr doc;
- if ((node == NULL) || (name == NULL))
+ if ((node == NULL) || (name == NULL) || (node->type != XML_ELEMENT_NODE))
return(NULL);
doc = node->doc;
prop = node->properties;