[libxml2] Fix a leak in XPath compilation
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Fix a leak in XPath compilation
- Date: Fri, 15 Oct 2010 16:31:48 +0000 (UTC)
commit 2f3523f61f1c7a2a0521c2f6c0db6c80e1cc4111
Author: Daniel Veillard <veillard redhat com>
Date: Fri Oct 15 18:30:29 2010 +0200
Fix a leak in XPath compilation
Sometimes a not well formed XPath expression could lead to a
leak as reported by Ralf Junker <ralfjunker gmx de>
xpath.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/xpath.c b/xpath.c
index 8b77af3..9d47618 100644
--- a/xpath.c
+++ b/xpath.c
@@ -11261,7 +11261,10 @@ xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
}
}
- CHECK_ERROR;
+ if (ctxt->error != XPATH_EXPRESSION_OK) {
+ xmlFree(name);
+ return;
+ }
name = xmlXPathCompNodeTest(ctxt, &test, &type, &prefix, name);
if (test == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]