diff options
author | Jakub Zelenka <bukka@php.net> | 2016-06-12 18:56:55 +0100 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2016-06-12 18:56:55 +0100 |
commit | b44cf1a8540d321583a0d83ebca688ebab10d3b0 (patch) | |
tree | b7fbafb4113ea150381a9bba7f98f45027e35b0b /sapi/phpdbg/phpdbg_list.c | |
parent | 6ac8bc4ecb1fdf112eefdd16d2c4f971e7ac232a (diff) | |
parent | a2f4c32eb14221de79009aadaa3da9c3349e3526 (diff) | |
download | php-git-b44cf1a8540d321583a0d83ebca688ebab10d3b0.tar.gz |
Merge branch 'PHP-7.0' into openssl_error_store
Diffstat (limited to 'sapi/phpdbg/phpdbg_list.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_list.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index 8bcf6c362b..6895bea43e 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -33,7 +33,7 @@ #include "php_streams.h" #include "zend_exceptions.h" -ZEND_EXTERN_MODULE_GLOBALS(phpdbg); +ZEND_EXTERN_MODULE_GLOBALS(phpdbg) #define PHPDBG_LIST_COMMAND_D(f, h, a, m, l, s, flags) \ PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[12], flags) @@ -232,6 +232,7 @@ void phpdbg_list_function_byname(const char *str, size_t len) /* {{{ */ efree(func_name); } /* }}} */ +/* Note: do not free the original file handler, let original compile_file() or caller do that. Caller may rely on its value to check success */ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { phpdbg_file_source data, *dataptr; zend_file_handle fake; @@ -242,7 +243,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { char resolved_path_buf[MAXPATHLEN]; if (zend_stream_fixup(file, &bufptr, &data.len) == FAILURE) { - return NULL; + return PHPDBG_G(compile_file)(file, type); } data.buf = emalloc(data.len + ZEND_MMAP_AHEAD + 1); @@ -279,6 +280,10 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { if (ret == NULL) { efree(data.buf); efree(dataptr); + + fake.opened_path = NULL; + zend_file_handle_dtor(&fake); + return NULL; } |