]> granicus.if.org Git - php/commitdiff
MFH: fix segfault in array_walk when retval_ptr is empty
authorRob Richards <rrichards@php.net>
Thu, 10 Feb 2005 23:00:53 +0000 (23:00 +0000)
committerRob Richards <rrichards@php.net>
Thu, 10 Feb 2005 23:00:53 +0000 (23:00 +0000)
 - such as when exception thrown

ext/standard/array.c

index ff3af2aa268c0b99c5c5ac55585eb889f93a503b..511e3cceaa14e65bfc08d1d34e306eb4ff272a72 100644 (file)
@@ -1052,7 +1052,9 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive
 
                        /* Call the userland function */
                        if (zend_call_function(&fci, &BG(array_walk_fci_cache) TSRMLS_CC) == SUCCESS) {
-                               zval_ptr_dtor(&retval_ptr);
+                               if (retval_ptr) {
+                                       zval_ptr_dtor(&retval_ptr);
+                               }
                        } else {
                                char *func_name;