]> granicus.if.org Git - php/commitdiff
simplify the patch and prevent NULL retval_ptr_ptr's
authorAntony Dovgal <tony2001@php.net>
Fri, 13 Jul 2007 08:50:53 +0000 (08:50 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 13 Jul 2007 08:50:53 +0000 (08:50 +0000)
ext/standard/basic_functions.c

index d90cba247938947f0250d706ef560e52dffd253e..5b5413761fdd2911ec64f23b4fe306e9339507c1 100644 (file)
@@ -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);