Skip to content

Close file_handle in fpm_main #10707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions sapi/fpm/fpm/fpm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1918,6 +1918,13 @@ consult the installation file that came with this distribution, or visit \n\

php_execute_script(&file_handle);

/* Without opcache, or the first time with opcache, the file handle will be placed
* in the CG(open_files) list by open_file_for_scanning(). Starting from the second
* request in opcache, the file handle won't be in the list and therefore won't be destroyed for us. */
if (!file_handle.in_list) {
zend_destroy_file_handle(&file_handle);
}

fastcgi_request_done:
if (EXPECTED(primary_script)) {
efree(primary_script);
Expand Down