Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f30e71c

Browse files
committed
Destroy file_handle in fpm_main
If it's not in the CG(open_files) list, we need to destroy the file handle ourselves. Co-authored-by: Jakub Zelenka <bukka@php.net> Closes GH-10707.
1 parent 06ae750 commit f30e71c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

‎NEWS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ PHP NEWS
1616

1717
- FPM:
1818
. Fixed bug GH-10611 (fpm_env_init_main leaks environ). (nielsdos)
19+
. Destroy file_handle in fpm_main. (Jakub Zelenka, nielsdos)
1920

2021
- FTP:
2122
. Propagate success status of ftp_close(). (nielsdos)

‎sapi/fpm/fpm/fpm_main.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,6 +1918,13 @@ consult the installation file that came with this distribution, or visit \n\
19181918

19191919
php_execute_script(&file_handle);
19201920

1921+
/* Without opcache, or the first time with opcache, the file handle will be placed
1922+
* in the CG(open_files) list by open_file_for_scanning(). Starting from the second
1923+
* request in opcache, the file handle won't be in the list and therefore won't be destroyed for us. */
1924+
if (!file_handle.in_list) {
1925+
zend_destroy_file_handle(&file_handle);
1926+
}
1927+
19211928
fastcgi_request_done:
19221929
if (EXPECTED(primary_script)) {
19231930
efree(primary_script);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /