diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 1bd5e2fd6059a..9922925415838 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -74,10 +74,7 @@ ZEND_GET_MODULE(readline) PHP_MINIT_FUNCTION(readline) { -#if HAVE_LIBREADLINE - /* libedit don't need this call which set the tty in cooked mode */ using_history(); -#endif ZVAL_UNDEF(&_readline_completion); #if HAVE_RL_CALLBACK_READ_CHAR ZVAL_UNDEF(&_prepped_callback); diff --git a/ext/readline/tests/gh17154.phpt b/ext/readline/tests/gh17154.phpt new file mode 100644 index 0000000000000..6645855becb6f --- /dev/null +++ b/ext/readline/tests/gh17154.phpt @@ -0,0 +1,12 @@ +--TEST-- +GH-17154 readline_write_history()/readline_read_history(): memory leak +--EXTENSIONS--my +readline +--FILE-- + +--EXPECTF-- +bool(true)