Fixed a potential memory leak in xmlSchemaCheckCSelectorXPath() when an
* xmlschemas.c: Fixed a potential memory leak in
xmlSchemaCheckCSelectorXPath() when an internal error occurs.
Fixed setting of ctxt->err to the given error code in
the parsing error functions.
* pattern.c: Added internal xmlCompileIDCXPathPath() as a
starting point for IDC XPath compilation; this and some other
tiny changes fixes issues regarding whitespace in the
expressions and IDC selector/field relevant restrictions of
the subset of XPath. Fixed a missing blocking of attributes
in xmlStreamPushInternal().
diff --git a/xmlschemas.c b/xmlschemas.c
index e1c3559..85fe141 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -1876,6 +1876,7 @@
if (ctxt != NULL) {
ctxt->nberrors++;
+ ctxt->err = error;
channel = ctxt->error;
data = ctxt->userData;
schannel = ctxt->serror;
@@ -1941,6 +1942,7 @@
if (ctxt != NULL) {
ctxt->nberrors++;
+ ctxt->err = error;
channel = ctxt->error;
data = ctxt->userData;
schannel = ctxt->serror;
@@ -7983,6 +7985,7 @@
if (nsArray == NULL) {
xmlSchemaPErrMemory(ctxt, "allocating a namespace array",
NULL);
+ xmlFree(nsList);
return (-1);
}
for (i = 0; i < count; i++) {