summaryrefslogtreecommitdiff
path: root/ext/readline/readline.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/readline/readline.c')
-rw-r--r--ext/readline/readline.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index e2131f500..3b674957c 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2008 The PHP Group |
+ | Copyright (c) 1997-2009 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: readline.c,v 1.42.2.3.2.4 2007/12/31 07:20:10 sebastian Exp $ */
+/* $Id: readline.c,v 1.42.2.3.2.9 2008/12/31 11:17:42 sebastian Exp $ */
/* {{{ includes & prototypes */
@@ -115,12 +115,14 @@ PHP_MINIT_FUNCTION(readline)
PHP_RSHUTDOWN_FUNCTION(readline)
{
- if (_readline_completion)
+ if (_readline_completion) {
+ zval_dtor(_readline_completion);
FREE_ZVAL(_readline_completion);
+ }
#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
@@ -456,9 +458,12 @@ PHP_FUNCTION(readline_completion_function)
efree(name);
RETURN_FALSE;
}
+ efree(name);
- if (_readline_completion)
+ if (_readline_completion) {
+ zval_dtor(_readline_completion);
FREE_ZVAL(_readline_completion);
+ }
MAKE_STD_ZVAL(_readline_completion);
*_readline_completion = *arg;
@@ -504,11 +509,14 @@ PHP_FUNCTION(readline_callback_handler_install)
if (!zend_is_callable(callback, 0, &name)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not callable", name);
+ efree(name);
RETURN_FALSE;
}
+ efree(name);
if (_prepped_callback) {
rl_callback_handler_remove();
+ zval_dtor(_prepped_callback);
FREE_ZVAL(_prepped_callback);
}
@@ -538,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;