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)
efree(fh->buf);
fh->buf = NULL;
}
+ if (fh->free_filename && fh->filename) {
+ efree((char*)fh->filename);
+ fh->filename = NULL;
+ }
}
/* }}} */
const char *filename;
zend_string *opened_path;
zend_stream_type type;
+ /* free_filename is used by wincache */
+ /* TODO: Clean up filename vs opened_path mess */
+ zend_bool free_filename;
char *buf;
size_t len;
} zend_file_handle;
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:
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) {
} else {
file_handle.filename = *p;
+ file_handle.free_filename = 0;
file_handle.opened_path = NULL;
php_execute_script(&file_handle);
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;
}
}