Skip to content

Commit e0eca26

Browse files
committed
Drop free_filename field from zend_file_handle
free_filename was always zero.
1 parent 49bac9b commit e0eca26

File tree

7 files changed

+0
-17
lines changed

7 files changed

+0
-17
lines changed

Zend/zend_language_scanner.l

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,6 @@ ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
292292
zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
293293
/* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */
294294
file_handle->opened_path = NULL;
295-
if (file_handle->free_filename) {
296-
file_handle->filename = NULL;
297-
}
298295
}
299296

300297
ZEND_API void zend_lex_tstring(zval *zv)

Zend/zend_stream.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle) /*
116116
handle->opened_path = NULL;
117117
handle->handle.fp = zend_fopen(filename, &handle->opened_path);
118118
handle->filename = filename;
119-
handle->free_filename = 0;
120119
memset(&handle->handle.stream.mmap, 0, sizeof(zend_mmap));
121120

122121
return (handle->handle.fp) ? SUCCESS : FAILURE;
@@ -261,10 +260,6 @@ ZEND_API void zend_file_handle_dtor(zend_file_handle *fh) /* {{{ */
261260
zend_string_release_ex(fh->opened_path, 0);
262261
fh->opened_path = NULL;
263262
}
264-
if (fh->free_filename && fh->filename) {
265-
efree((char*)fh->filename);
266-
fh->filename = NULL;
267-
}
268263
}
269264
/* }}} */
270265

Zend/zend_stream.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ typedef struct _zend_file_handle {
6565
const char *filename;
6666
zend_string *opened_path;
6767
zend_stream_type type;
68-
zend_bool free_filename;
6968
} zend_file_handle;
7069

7170
BEGIN_EXTERN_C()

ext/phar/phar.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3261,7 +3261,6 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type)
32613261
efree(f.opened_path);
32623262
}
32633263
f.opened_path = file_handle->opened_path;
3264-
f.free_filename = file_handle->free_filename;
32653264

32663265
switch (file_handle->type) {
32673266
case ZEND_HANDLE_STREAM:

main/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,6 @@ PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *h
15851585
if (stream) {
15861586
handle->type = ZEND_HANDLE_STREAM;
15871587
handle->filename = (char*)filename;
1588-
handle->free_filename = 0;
15891588
handle->handle.stream.handle = stream;
15901589
handle->handle.stream.reader = (zend_stream_reader_t)_php_stream_read;
15911590
handle->handle.stream.fsizer = php_zend_stream_fsizer;

sapi/litespeed/lsapi_main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,6 @@ static int cli_main( int argc, char * argv[] )
13131313
highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini);
13141314
} else if (source_highlight == 2) {
13151315
file_handle.filename = *p;
1316-
file_handle.free_filename = 0;
13171316
file_handle.opened_path = NULL;
13181317
ret = php_lint_script(&file_handle);
13191318
if (ret==SUCCESS) {
@@ -1324,7 +1323,6 @@ static int cli_main( int argc, char * argv[] )
13241323

13251324
} else {
13261325
file_handle.filename = *p;
1327-
file_handle.free_filename = 0;
13281326
file_handle.opened_path = NULL;
13291327

13301328
php_execute_script(&file_handle);

sapi/phpdbg/phpdbg_list.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,6 @@ zend_op_array *phpdbg_init_compile_file(zend_file_handle *file, int type) {
294294
zend_string_release(file->opened_path);
295295
file->opened_path = zend_string_init(filename, strlen(filename), 0);
296296
} else {
297-
if (file->free_filename) {
298-
efree((char *) file->filename);
299-
}
300-
file->free_filename = 0;
301297
file->filename = filename;
302298
}
303299
}

0 commit comments

Comments
 (0)