Skip to content

Commit

Permalink
- MFH: Fixed memory leak in readline_callback_handler_remove()
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Nov 21, 2008
1 parent f358f96 commit 572b3f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/readline/readline.c
Expand Up @@ -516,7 +516,8 @@ PHP_FUNCTION(readline_callback_handler_install)

if (_prepped_callback) {
rl_callback_handler_remove();
zval_ptr_dtor(&_prepped_callback);
zval_dtor(_prepped_callback);
FREE_ZVAL(_prepped_callback);
}

MAKE_STD_ZVAL(_prepped_callback);
Expand Down Expand Up @@ -545,6 +546,7 @@ PHP_FUNCTION(readline_callback_handler_remove)
{
if (_prepped_callback) {
rl_callback_handler_remove();
zval_dtor(_prepped_callback);
FREE_ZVAL(_prepped_callback);
_prepped_callback = 0;
RETURN_TRUE;
Expand Down

0 comments on commit 572b3f8

Please sign in to comment.