From 5063b5aea16a512794e482a4a0b660b018f3f60b Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 13 Jul 2016 23:35:53 +0200 Subject: [PATCH] Fix leak if throw_exception_object() fails --- Zend/zend_exceptions.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 374f3045b3..4d1b016cbb 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -1070,6 +1070,7 @@ ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception) /* {{{ */ if (!exception_ce || !instanceof_function(exception_ce, zend_ce_throwable)) { zend_throw_error(NULL, "Cannot throw objects that do not implement Throwable"); + zval_ptr_dtor(exception); return; } zend_throw_exception_internal(exception); -- 2.50.1