]> granicus.if.org Git - php/commitdiff
MFB: Fixed memory leak inside readline_callback_handler_install() function
authorIlia Alshanetsky <iliaa@php.net>
Sun, 16 Nov 2008 18:01:25 +0000 (18:01 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 16 Nov 2008 18:01:25 +0000 (18:01 +0000)
NEWS
ext/readline/readline.c

diff --git a/NEWS b/NEWS
index af87b0f5b4f05cf8d9afe7c447cb9d7db25208bd..da98849130d73740a6af0861c89188a8fa4c1319 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ PHP                                                                        NEWS
 - Fixed sybase_fetch_*() to continue reading after CS_ROW_FAIL status (Timm)
 - Fixed a bug inside dba_replace() that could cause file truncation with
   invalid keys. (Ilia)
+- Fixed memory leak inside readline_callback_handler_install() function.
+  (Ilia)
 
 - Fixed bug #46543 (ibase_trans() memory leaks when using wrong parameters).
   (Felipe)
index 6bd992726cb6553bc5180deb1cdaf20306f4befd..9060a624645eb8b746f0746bc4d4c579b37e443c 100644 (file)
@@ -120,7 +120,7 @@ PHP_RSHUTDOWN_FUNCTION(readline)
 #if HAVE_RL_CALLBACK_READ_CHAR
        if (_prepped_callback) {
                rl_callback_handler_remove();
-               FREE_ZVAL(_prepped_callback);
+               zval_ptr_dtor(&_prepped_callback);
                _prepped_callback = 0;
        }
 #endif
@@ -507,10 +507,11 @@ PHP_FUNCTION(readline_callback_handler_install)
                efree(name);
                RETURN_FALSE;
        }
+       efree(name);
 
        if (_prepped_callback) {
                rl_callback_handler_remove();
-               FREE_ZVAL(_prepped_callback);
+               zval_ptr_dtor(&_prepped_callback);
        }
 
        MAKE_STD_ZVAL(_prepped_callback);