Skip to content

Commit 674bcca

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Destroy file_handle in fpm_main
2 parents 33dd226 + e44b1a9 commit 674bcca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sapi/fpm/fpm/fpm_main.c

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

19051905
php_execute_script(&file_handle);
19061906

1907+
/* Without opcache, or the first time with opcache, the file handle will be placed
1908+
* in the CG(open_files) list by open_file_for_scanning(). Starting from the second
1909+
* request in opcache, the file handle won't be in the list and therefore won't be destroyed for us. */
1910+
if (!file_handle.in_list) {
1911+
zend_destroy_file_handle(&file_handle);
1912+
}
1913+
19071914
fastcgi_request_done:
19081915
if (EXPECTED(primary_script)) {
19091916
efree(primary_script);

0 commit comments

Comments
 (0)