From: Nikita Popov Date: Wed, 13 Jul 2016 21:35:53 +0000 (+0200) Subject: Fix leak if throw_exception_object() fails X-Git-Tag: php-7.1.0beta1~61^2~3^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5063b5aea16a512794e482a4a0b660b018f3f60b;p=php Fix leak if throw_exception_object() fails --- 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);