]> granicus.if.org Git - php/commitdiff
fix for test Nr 3 bug (not freeing all params)
authorChristian Stocker <chregu@php.net>
Mon, 27 Oct 2003 12:16:35 +0000 (12:16 +0000)
committerChristian Stocker <chregu@php.net>
Mon, 27 Oct 2003 12:16:35 +0000 (12:16 +0000)
ext/xsl/xsltprocessor.c

index 89dc4c4e046b60e7f67d92863c1634a4736b3214..d5924d9d8bdd1deeb8844b19da8c3a78ec3247d8 100644 (file)
@@ -103,7 +103,7 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS
                        if (!xpath_params) {
                                xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC);
                        } else {
-                               xpath_expr = Z_STRVAL_PP(value);
+                               xpath_expr = estrndup(Z_STRVAL_PP(value), strlen(Z_STRVAL_PP(value)));
                        }
                        if (xpath_expr) {
                                params[i++] = string_key;
@@ -207,6 +207,10 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
        }
 
        if (params) {
+               clone = 0;
+               while(params[clone]) {
+                       efree(params[clone++]);
+               }
                efree(params);
        }
 
@@ -258,6 +262,10 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
        }
 
        if (params) {
+               clone = 0;
+               while(params[clone]) {
+                       efree(params[clone++]);
+               }
                efree(params);
        }
 
@@ -311,6 +319,10 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
        }
 
        if (params) {
+               clone = 0;
+               while(params[clone]) {
+                       efree(params[clone++]);
+               }
                efree(params);
        }