summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_execute.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 5c00d7f8df..1ed41167b6 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -2724,6 +2724,9 @@ int zend_do_fcall_common_helper(ZEND_OPCODE_HANDLER_ARGS)
zend_ptr_stack_clear_multiple(TSRMLS_C);
if (EG(exception)) {
+ if (return_value_used) {
+ zval_ptr_dtor(&EX_T(EX(opline)->result.u.var).var.ptr);
+ }
if (EX(opline)->op2.u.opline_num == -1) {
RETURN_FROM_EXECUTE_LOOP(execute_data);
} else {