From 54eb5008f13cfc980b353f3acdff594ecd377962 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 16 Apr 2023 15:54:45 +0100 Subject: [PATCH] FPM: Fix memory leak for invalid primary script file handle --- sapi/fpm/fpm/fpm_main.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 64ef27dadeb3..b91bb8d055df 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1924,19 +1924,16 @@ consult the installation file that came with this distribution, or visit \n\ } } zend_catch { } zend_end_try(); - /* we want to serve more requests if this is fastcgi - * so cleanup and continue, request shutdown is - * handled later */ - - goto fastcgi_request_done; - } - - fpm_request_executing(); + /* We want to serve more requests if this is fastcgi so cleanup and continue, + * request shutdown is handled later. */ + } else { + fpm_request_executing(); - /* Reset exit status from the previous execution */ - EG(exit_status) = 0; + /* Reset exit status from the previous execution */ + EG(exit_status) = 0; - php_execute_script(&file_handle); + 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