1
0
mirror of https://github.com/php/php-src.git synced 2026-04-12 02:23:18 +02:00

This should fix the fd leak with include()/require()

This commit is contained in:
Zeev Suraski
1999-12-04 10:59:30 +00:00
parent 2b3f80b776
commit cad92c80cc

View File

@@ -249,10 +249,10 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
if (!file_handle->handle.fp) {
return FAILURE;
}
file_handle->type = ZEND_HANDLE_FP;
if (file_handle->handle.fp != stdin) {
zend_llist_add_element(&CG(open_files), file_handle);
}
file_handle->type = ZEND_HANDLE_FP;
/* Reset the scanner for scanning the new file */
yyin = file_handle->handle.fp;
yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));