felipe          Fri Jul 18 17:34:07 2008 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/xmlrpc xmlrpc-epi-php.c 
  Log:
  - Fixed bug #45556 (Return value from callback isn't freed)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xmlrpc/xmlrpc-epi-php.c?r1=1.39.2.5.2.10&r2=1.39.2.5.2.11&diff_format=u
Index: php-src/ext/xmlrpc/xmlrpc-epi-php.c
diff -u php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.39.2.5.2.10 
php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.39.2.5.2.11
--- php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.39.2.5.2.10   Fri Jul 18 15:52:38 2008
+++ php-src/ext/xmlrpc/xmlrpc-epi-php.c Fri Jul 18 17:34:07 2008
@@ -51,7 +51,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: xmlrpc-epi-php.c,v 1.39.2.5.2.10 2008/07/18 15:52:38 felipe Exp $ */
+/* $Id: xmlrpc-epi-php.c,v 1.39.2.5.2.11 2008/07/18 17:34:07 felipe Exp $ */
 
 /**********************************************************************
 * BUGS:                                                               *
@@ -877,15 +877,12 @@
  */
 static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data)
 {
-       zval *retval_ptr, **php_function;
+       zval retval, **php_function;
        zval* callback_params[1];
        char *php_function_name;
        xmlrpc_callback_data* pData = (xmlrpc_callback_data*)data;
        TSRMLS_FETCH();
 
-       MAKE_STD_ZVAL(retval_ptr);
-       Z_TYPE_P(retval_ptr) = IS_NULL;
-
        /* setup data hoojum */
        callback_params[0] = pData->caller_params;
 
@@ -896,14 +893,14 @@
 
                        if (zend_is_callable(*php_function, 0, 
&php_function_name)) {
                                /* php func prototype: function string 
user_func($user_params) */
-                               if (call_user_function(CG(function_table), 
NULL, *php_function, retval_ptr, 1, callback_params TSRMLS_CC) == SUCCESS) {
+                               if (call_user_function(CG(function_table), 
NULL, *php_function, &retval, 1, callback_params TSRMLS_CC) == SUCCESS) {
                                        XMLRPC_VALUE xData;
                                        STRUCT_XMLRPC_ERROR err = {0};
 
                                        /* return value should be a string */
-                                       convert_to_string(retval_ptr);
+                                       convert_to_string(&retval);
 
-                                       xData = 
XMLRPC_IntrospectionCreateDescription(Z_STRVAL_P(retval_ptr), &err);
+                                       xData = 
XMLRPC_IntrospectionCreateDescription(Z_STRVAL(retval), &err);
 
                                        if(xData) {
                                                
if(!XMLRPC_ServerAddIntrospectionData(server, xData)) {
@@ -919,6 +916,7 @@
                                                        php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "Unable to add introspection data returned from %s()", 
php_function_name);
                                                }
                                        }
+                                       zval_dtor(&retval);
                                } else {
                                        /* user func failed */
                                        php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Error calling user introspection callback: %s()", 
php_function_name);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to