fixed 2 leaks with namespaced variable names. added test case for above
authorDaniel Veillard <veillard@src.gnome.org>
Sat, 25 Sep 2004 19:42:07 +0000 (19:42 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Sat, 25 Sep 2004 19:42:07 +0000 (19:42 +0000)
* libxslt/preproc.c libxslt/variables.c: fixed 2 leaks with
  namespaced variable names.
* tests/general/bug-154.*, tests/general/Makefile.am,
  tests/docs/bug-154*, tests/docs/Makefile.am: added test case
  for above
Daniel

ChangeLog
libxslt/preproc.c
libxslt/variables.c
tests/docs/Makefile.am
tests/docs/bug-154.xml [new file with mode: 0644]
tests/general/Makefile.am
tests/general/bug-154.out [new file with mode: 0644]
tests/general/bug-154.xsl [new file with mode: 0644]

index 969ecd6..0816d4c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sat Sep 25 21:38:57 CEST 2004 Daniel Veillard <daniel@veillard.com>
+
+       * libxslt/preproc.c libxslt/variables.c: fixed 2 leaks with
+         namespaced variable names.
+       * tests/general/bug-154.*, tests/general/Makefile.am,
+         tests/docs/bug-154*, tests/docs/Makefile.am: added test case
+         for above
+
 Fri Sep 24 18:13:45 CEST 2004 Daniel Veillard <daniel@veillard.com>
 
        * Makefile.am: add missing variable
index 20f1cce..963b465 100644 (file)
@@ -1057,7 +1057,7 @@ xsltVariableComp(xsltStylesheetPtr style, xmlNodePtr inst) {
            comp->name = prop;
            comp->has_name = 1;
            if (URI != NULL) {
-               comp->ns = xmlStrdup(URI);
+               comp->ns = xmlDictLookup(style->dict, URI, -1);
                comp->has_ns = 1;
            } else {
                comp->has_ns = 0;
index 00b07b9..6304259 100644 (file)
@@ -823,7 +823,7 @@ xsltRegisterGlobalVariable(xsltStylesheetPtr style, const xmlChar *name,
     elem->name = xmlDictLookup(style->dict, name, -1);
     elem->select = xmlDictLookup(style->dict, select, -1);
     if (ns_uri)
-       elem->nameURI = xmlStrdup(ns_uri);
+       elem->nameURI = xmlDictLookup(style->dict, ns_uri, -1);
     elem->tree = tree;
     tmp = style->variables;
     if (tmp == NULL) {
index a86d91f..a50a358 100644 (file)
@@ -153,6 +153,7 @@ EXTRA_DIST =        \
        bug-151.xml \
        bug-152.xml \
        bug-153.xml bug-153.doc \
+       bug-154.xml \
        character.xml \
        array.xml \
        items.xml
diff --git a/tests/docs/bug-154.xml b/tests/docs/bug-154.xml
new file mode 100644 (file)
index 0000000..69d62f2
--- /dev/null
@@ -0,0 +1 @@
+<doc/>
index 74e4851..e02b4e0 100644 (file)
@@ -161,6 +161,7 @@ EXTRA_DIST = \
     bug-151.out bug-151.xsl \
     bug-152.out bug-152.xsl \
     bug-153.out bug-153.xsl \
+    bug-154.out bug-154.xsl \
     character.out character.xsl \
     character2.out character2.xsl \
     itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-154.out b/tests/general/bug-154.out
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/general/bug-154.xsl b/tests/general/bug-154.xsl
new file mode 100644 (file)
index 0000000..873cf6d
--- /dev/null
@@ -0,0 +1,4 @@
+<xsl:transform version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:test="#">
+<xsl:variable name="test:foo" select="'abc'"/>
+</xsl:transform>