Fix memory leak in xmlXPathEvalExpression()
* xpath.c: plug some leaks when parsing misformed XPath expressions
* python/tests/xpathleak.py: expand the regression tests for those
diff --git a/xpath.c b/xpath.c
index 5b84d22..8482c40 100644
--- a/xpath.c
+++ b/xpath.c
@@ -11333,6 +11333,7 @@
SKIP_BLANKS;
}
xmlXPathCompStep(ctxt);
+ CHECK_ERROR;
SKIP_BLANKS;
while (CUR == '/') {
if ((CUR == '/') && (NXT(1) == '/')) {
@@ -11392,6 +11393,7 @@
(CUR == '@') || (CUR == '*')))
xmlXPathCompRelativeLocationPath(ctxt);
}
+ CHECK_ERROR;
}
}
}