From 8f7381a6eaac453cf08be8100cf69b7204508829 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 14 Feb 2012 05:35:34 +0000 Subject: [PATCH] Fixed bug #61072 (Memory leak when restoring an exception handler) --- NEWS | 2 ++ Zend/zend_builtin_functions.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) 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(); -- 2.40.0