components/libxml2/patches/05.mem-leak-fix.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 29 Aug 2012 11:05:56 -0700
changeset 957 255465c5756f
parent 284 ca417a821aee
permissions -rw-r--r--
Close of build 04.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
148
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     1
diff --git a/python/tests/xpathleak.py b/python/tests/xpathleak.py
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     2
index dcc144c..879de1c 100644
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     3
--- a/python/tests/xpathleak.py
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     4
+++ b/python/tests/xpathleak.py
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     5
@@ -27,7 +27,11 @@ libxml2.registerErrorHandler(callback, "-->")
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     6
 doc = libxml2.parseDoc("<fish/>")
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     7
 ctxt = doc.xpathNewContext()
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     8
 ctxt.setContextNode(doc)
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
     9
-for expr in (":false()","bad:()","bad(:)",":bad(:)","bad:(:)","bad:bad(:)"):
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    10
+badexprs = (
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    11
+	":false()", "bad:()", "bad(:)", ":bad(:)", "bad:(:)", "bad:bad(:)",
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    12
+	"a:/b", "/c:/d", "//e:/f", "g://h"
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    13
+	)
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    14
+for expr in badexprs:
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    15
 	try:
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    16
 		ctxt.xpathEval(expr)
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    17
 	except libxml2.xpathError, e:
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    18
diff --git a/xpath.c b/xpath.c
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    19
index 5b84d22..8482c40 100644
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    20
--- a/xpath.c
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    21
+++ b/xpath.c
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    22
@@ -11333,6 +11333,7 @@ xmlXPathCompRelativeLocationPath
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    23
 	SKIP_BLANKS;
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    24
     }
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    25
     xmlXPathCompStep(ctxt);
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    26
+    CHECK_ERROR;
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    27
     SKIP_BLANKS;
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    28
     while (CUR == '/') {
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    29
 	if ((CUR == '/') && (NXT(1) == '/')) {
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    30
@@ -11392,6 +11393,7 @@ xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) {
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    31
 		     (CUR == '@') || (CUR == '*')))
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    32
 		    xmlXPathCompRelativeLocationPath(ctxt);
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    33
 	    }
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    34
+	    CHECK_ERROR;
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    35
 	}
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    36
     }
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    37
 }
33ca3897ae25 7029701 libxml2 should move to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff changeset
    38