]> granicus.if.org Git - php/commitdiff
fix bug #44891 Memory leak using registerPHPFunctions and XSLT Variable
authorRob Richards <rrichards@php.net>
Sun, 4 May 2008 15:13:39 +0000 (15:13 +0000)
committerRob Richards <rrichards@php.net>
Sun, 4 May 2008 15:13:39 +0000 (15:13 +0000)
ext/xsl/xsltprocessor.c

index 7364d8309cb2069101adb9c928be56d600457b5b..e4f8983f3e15d07205e7de40e8a9d9c58e4d46c5 100644 (file)
@@ -287,7 +287,9 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
                                }
                                break;
                        default:
-                       ZVAL_STRING(args[i], xmlXPathCastToString(obj), 1);
+                               str = xmlXPathCastToString(obj);
+                               ZVAL_STRING(args[i], str, 1);
+                               xmlFree(str);
                }
                xmlXPathFreeObject(obj);
                fci.params[i] = &args[i];