]> granicus.if.org Git - php/commitdiff
Drop free_filename field from zend_file_handle
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 16 Jul 2019 14:50:22 +0000 (16:50 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 16 Jul 2019 15:07:26 +0000 (17:07 +0200)
free_filename was always zero.

Zend/zend_language_scanner.l
Zend/zend_stream.c
Zend/zend_stream.h
ext/phar/phar.c
main/main.c
sapi/litespeed/lsapi_main.c
sapi/phpdbg/phpdbg_list.c

index 5526a0a0b352d50c34deb094ec67e9dbcba65a37..82e884d583f169841434d5ba8e5eea928c554135 100644 (file)
@@ -292,9 +292,6 @@ ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
        zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
        /* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */
        file_handle->opened_path = NULL;
-       if (file_handle->free_filename) {
-               file_handle->filename = NULL;
-       }
 }
 
 ZEND_API void zend_lex_tstring(zval *zv)
index 08a1db2583a809656720781e95a4483be41c3838..9e81e3acaba2529967e8d45dc4ce40a63a19b32d 100644 (file)
@@ -116,7 +116,6 @@ ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle) /*
        handle->opened_path = NULL;
        handle->handle.fp = zend_fopen(filename, &handle->opened_path);
        handle->filename = filename;
-       handle->free_filename = 0;
        memset(&handle->handle.stream.mmap, 0, sizeof(zend_mmap));
 
        return (handle->handle.fp) ? SUCCESS : FAILURE;
@@ -261,10 +260,6 @@ ZEND_API void zend_file_handle_dtor(zend_file_handle *fh) /* {{{ */
                zend_string_release_ex(fh->opened_path, 0);
                fh->opened_path = NULL;
        }
-       if (fh->free_filename && fh->filename) {
-               efree((char*)fh->filename);
-               fh->filename = NULL;
-       }
 }
 /* }}} */
 
index 18b07d6b3cafb78231cb3107a6bcdac2b2eae1c7..a554bb884c5610ec609d6214e0ae1b44461be3b4 100644 (file)
@@ -65,7 +65,6 @@ typedef struct _zend_file_handle {
        const char        *filename;
        zend_string       *opened_path;
        zend_stream_type  type;
-       zend_bool free_filename;
 } zend_file_handle;
 
 BEGIN_EXTERN_C()
index 6d32e2c8354f704f56efadc5c252a1d161d389c3..8da3c364e1515590d4c04aa6cd091ecec433f9c3 100644 (file)
@@ -3261,7 +3261,6 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type)
                                                efree(f.opened_path);
                                        }
                                        f.opened_path = file_handle->opened_path;
-                                       f.free_filename = file_handle->free_filename;
 
                                        switch (file_handle->type) {
                                                case ZEND_HANDLE_STREAM:
index 90cf190f431baa0251a3f26f86dad7d79bce19c0..d3eae3c148014daa533ad5e672a60d9ca92351d4 100644 (file)
@@ -1585,7 +1585,6 @@ PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *h
        if (stream) {
                handle->type = ZEND_HANDLE_STREAM;
                handle->filename = (char*)filename;
-               handle->free_filename = 0;
                handle->handle.stream.handle  = stream;
                handle->handle.stream.reader  = (zend_stream_reader_t)_php_stream_read;
                handle->handle.stream.fsizer  = php_zend_stream_fsizer;
index baff98df1e2d4570563c25f183fec76fcd007f71..0859d4a9b366800bfbbad7dc38d0d6ca75bdd4ad 100644 (file)
@@ -1313,7 +1313,6 @@ static int cli_main( int argc, char * argv[] )
                             highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini);
                         } else if (source_highlight == 2) {
                             file_handle.filename = *p;
-                            file_handle.free_filename = 0;
                             file_handle.opened_path = NULL;
                             ret = php_lint_script(&file_handle);
                             if (ret==SUCCESS) {
@@ -1324,7 +1323,6 @@ static int cli_main( int argc, char * argv[] )
 
                         } else {
                             file_handle.filename = *p;
-                            file_handle.free_filename = 0;
                             file_handle.opened_path = NULL;
 
                             php_execute_script(&file_handle);
index 03b4c3526e30e604c91e3f5ffa7ef92b5d293193..fe612be3258e7d3118d6b56d75239d1825f62369 100644 (file)
@@ -294,10 +294,6 @@ zend_op_array *phpdbg_init_compile_file(zend_file_handle *file, int type) {
                        zend_string_release(file->opened_path);
                        file->opened_path = zend_string_init(filename, strlen(filename), 0);
                } else {
-                       if (file->free_filename) {
-                               efree((char *) file->filename);
-                       }
-                       file->free_filename = 0;
                        file->filename = filename;
                }
        }