From bb9ba8e36e70e41d6643150b283111a04a269a88 Mon Sep 17 00:00:00 2001 From: Rob Richards Date: Thu, 10 Feb 2005 22:59:26 +0000 Subject: [PATCH] fix segfault when retval_ptr is empty - such as when exception thrown --- ext/standard/array.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index ba3f2aa103..270ba0dc50 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -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; -- 2.40.0