FPM: Fix memory leak for invalid primary script file handle

Closes GH-11088
This commit is contained in:
Jakub Zelenka 2023-04-16 15:54:45 +01:00
parent 5e64ead64a
commit 4294e8d448
No known key found for this signature in database
GPG Key ID: 1C0779DC5C0A9DE4
2 changed files with 9 additions and 11 deletions

1
NEWS
View File

@ -19,6 +19,7 @@ PHP NEWS
child->ev_std(out|err)). (Jakub Zelenka)
. Fixed bug #64539 (FPM status page: query_string not properly JSON encoded).
(Jakub Zelenka)
. Fixed memory leak for invalid primary script file handle. (Jakub Zelenka)
- Hash:
. Fixed bug GH-11180 (hash_file() appears to be restricted to 3 arguments).

View File

@ -1924,20 +1924,17 @@ 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 */
/* We want to serve more requests if this is fastcgi so cleanup and continue,
* request shutdown is handled later. */
} else {
fpm_request_executing();
goto fastcgi_request_done;
/* Reset exit status from the previous execution */
EG(exit_status) = 0;
php_execute_script(&file_handle);
}
fpm_request_executing();
/* Reset exit status from the previous execution */
EG(exit_status) = 0;
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. */