]> granicus.if.org Git - php/commitdiff
Fixed use after free on closure_call_leak_with_exception.phpt
authorXinchen Hui <laruence@php.net>
Tue, 7 Jul 2015 10:19:57 +0000 (18:19 +0800)
committerXinchen Hui <laruence@php.net>
Tue, 7 Jul 2015 10:19:57 +0000 (18:19 +0800)
Zend/zend_execute.c

index 6122566b3e64a902a694e95ce61ce71594645b2b..3bd1917539fa89e6b9fd61c33c700de57067c58e 100644 (file)
@@ -2488,8 +2488,7 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
                        }
                        if (call->func->common.fn_flags & ZEND_ACC_CLOSURE) {
                                zend_object_release((zend_object *) call->func->common.prototype);
-                       }
-                       if (call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
+                       } else if (call->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
                                zend_string_release(call->func->common.function_name);
                                zend_free_trampoline(call->func);
                        }