]> granicus.if.org Git - php/commitdiff
fix segfault when retval_ptr is empty - such as when exception thrown
authorRob Richards <rrichards@php.net>
Thu, 10 Feb 2005 22:59:26 +0000 (22:59 +0000)
committerRob Richards <rrichards@php.net>
Thu, 10 Feb 2005 22:59:26 +0000 (22:59 +0000)
ext/standard/array.c

index ba3f2aa103b88f85231132a6ea29fc6afe8801d4..270ba0dc50e3a5434febcdcc43b079c9082660e7 100644 (file)
@@ -1084,7 +1084,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;