diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2015-07-24 17:17:09 +0200 |
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2015-07-24 17:17:26 +0200 |
| commit | 13525328ede9db6f8235b4e7f91f7bce80235880 (patch) | |
| tree | 8f41b6e661f9b6e9eca9c93dc4e1690fc4bcf7a5 /sapi/phpdbg/phpdbg_list.c | |
| parent | bf1ecbfe168e0f59c0deacbf7f2012c0d36a7f08 (diff) | |
| download | php-git-13525328ede9db6f8235b4e7f91f7bce80235880.tar.gz | |
Cleanup shutdown, enable proper memory leak displaying
phpdbg should not memory leak...
Diffstat (limited to 'sapi/phpdbg/phpdbg_list.c')
| -rw-r--r-- | sapi/phpdbg/phpdbg_list.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index 6d5e894930..bd6718f521 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -253,8 +253,8 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { } #if HAVE_MMAP - if (file->handle.stream.mmap.map) { - data.map = file->handle.stream.mmap.map; + if (file->type == ZEND_HANDLE_MAPPED) { + data.map = file->handle.stream.handle; } #endif @@ -289,11 +289,13 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { zend_file_handle_dtor(&fake); dataptr->op_array = ret; - if (dataptr->op_array->refcount) { - ++*dataptr->op_array->refcount; - } else { - dataptr->op_array->refcount = emalloc(sizeof(uint32_t)); - *dataptr->op_array->refcount = 2; + if (data->op_array) { + if (dataptr->op_array->refcount) { + ++*dataptr->op_array->refcount; + } else { + dataptr->op_array->refcount = emalloc(sizeof(uint32_t)); + *dataptr->op_array->refcount = 2; + } } return ret; @@ -304,7 +306,7 @@ void phpdbg_free_file_source(zval *zv) { #if HAVE_MMAP if (data->map) { - munmap(data->map, data->len + ZEND_MMAP_AHEAD); + php_stream_mmap_unmap(data->map); } else #endif if (data->buf) { |
