From: Xinchen Hui Date: Tue, 14 Feb 2012 05:35:34 +0000 (+0000) Subject: Fixed bug #61072 (Memory leak when restoring an exception handler) X-Git-Tag: PHP-5.4.1-RC1~26^2~82 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f7381a6eaac453cf08be8100cf69b7204508829;p=php Fixed bug #61072 (Memory leak when restoring an exception handler) --- diff --git a/NEWS b/NEWS index e4f484e52d..4044a2c597 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ PHP NEWS . Fixed bug #54682 (tidy null pointer dereference). (Tony, David Soria Parra) - Core: + . Fixed bug #61072 (Memory leak when restoring an exception handler). + (Nikic, Laruence) . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical vars). (Laruence) . Fix bug #60895 (Possible invalid handler usage in windows random diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 73a0a2a3d1..8d39a31ad0 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1516,8 +1516,7 @@ ZEND_FUNCTION(set_exception_handler) RETURN_TRUE; } - *EG(user_exception_handler) = *exception_handler; - zval_copy_ctor(EG(user_exception_handler)); + MAKE_COPY_ZVAL(&exception_handler, EG(user_exception_handler)) if (!had_orig_exception_handler) { RETURN_NULL();