From: Xinchen Hui Date: Fri, 2 Mar 2012 02:56:08 +0000 (+0000) Subject: MFH: Fixed bug #61072 (Memory leak when restoring an exception handler). X-Git-Tag: PHP-5.4.1-RC1~115 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=213145a6dafe300518d4fdb6e27995d6d8bf9286;p=php MFH: Fixed bug #61072 (Memory leak when restoring an exception handler). --- diff --git a/NEWS b/NEWS index 52d2c5636e..fabadc8ecc 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ PHP NEWS - Core: . Fixed bug #61225 (Incorect lexing of 0b00*+). (Pierrick) . Fixed bug #61165 (Segfault - strip_tags()). (Laruence) + . Fixed bug #61072 (Memory leak when restoring an exception handler). + (Nikic, Laruence) - Standard: . Fixed memory leak in substr_replace. (Pierrick) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 3bfefec523..b55231d0c6 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1615,8 +1615,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();