From 41fa157c441c374f5d8b312c962b502f59a1b31e Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sun, 11 Mar 2012 09:19:38 +0000 Subject: [PATCH] Fixed bug #61088 (Memory leak in readline_callback_handler_install). --- NEWS | 4 ++++ ext/readline/readline.c | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 1df43344b5..5c4c8ac396 100644 --- a/NEWS +++ b/NEWS @@ -57,6 +57,10 @@ PHP NEWS - PHP-FPM SAPI: . Fixed bug #60811 (php-fpm compilation problem). (rasmus) +- Readline: + . Fixed bug #61088 (Memory leak in readline_callback_handler_install). + (Nikic, Laruence) + - SOAP . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry) . Fixed bug #60887 (SoapClient ignores user_agent option and sends no diff --git a/ext/readline/readline.c b/ext/readline/readline.c index b93d6cc0f4..c514cb8fd0 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -561,9 +561,8 @@ PHP_FUNCTION(readline_callback_handler_install) FREE_ZVAL(_prepped_callback); } - MAKE_STD_ZVAL(_prepped_callback); - *_prepped_callback = *callback; - zval_copy_ctor(_prepped_callback); + ALLOC_ZVAL(_prepped_callback); + MAKE_COPY_ZVAL(&callback, _prepped_callback); rl_callback_handler_install(prompt, php_rl_callback_handler); -- 2.40.0