From: Antony Dovgal Date: Fri, 13 Jul 2007 08:50:53 +0000 (+0000) Subject: simplify the patch and prevent NULL retval_ptr_ptr's X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~140 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d0a4b2fe74eb46fe7cb08361432b9d3e64f08f1;p=php simplify the patch and prevent NULL retval_ptr_ptr's --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index d90cba2479..5b5413761f 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5042,10 +5042,8 @@ PHP_FUNCTION(call_user_func) fci.retval_ptr_ptr = &retval_ptr; - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS) { - *return_value = **fci.retval_ptr_ptr; - zval_copy_ctor(return_value); - zval_ptr_dtor(fci.retval_ptr_ptr); + if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) { + COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr); } if (fci.params) { @@ -5069,10 +5067,8 @@ PHP_FUNCTION(call_user_func_array) zend_fcall_info_args(&fci, params TSRMLS_CC); fci.retval_ptr_ptr = &retval_ptr; - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS) { - *return_value = **fci.retval_ptr_ptr; - zval_copy_ctor(return_value); - zval_ptr_dtor(fci.retval_ptr_ptr); + if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) { + COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr); } zend_fcall_info_args_clear(&fci, 1);