Skip to content

Commit 4294e8d

Browse files
committed
FPM: Fix memory leak for invalid primary script file handle
Closes GH-11088
1 parent 5e64ead commit 4294e8d

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ PHP NEWS
1919
child->ev_std(out|err)). (Jakub Zelenka)
2020
. Fixed bug #64539 (FPM status page: query_string not properly JSON encoded).
2121
(Jakub Zelenka)
22+
. Fixed memory leak for invalid primary script file handle. (Jakub Zelenka)
2223

2324
- Hash:
2425
. Fixed bug GH-11180 (hash_file() appears to be restricted to 3 arguments).

sapi/fpm/fpm/fpm_main.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,19 +1924,16 @@ consult the installation file that came with this distribution, or visit \n\
19241924
}
19251925
} zend_catch {
19261926
} zend_end_try();
1927-
/* we want to serve more requests if this is fastcgi
1928-
* so cleanup and continue, request shutdown is
1929-
* handled later */
1930-
1931-
goto fastcgi_request_done;
1932-
}
1933-
1934-
fpm_request_executing();
1927+
/* We want to serve more requests if this is fastcgi so cleanup and continue,
1928+
* request shutdown is handled later. */
1929+
} else {
1930+
fpm_request_executing();
19351931

1936-
/* Reset exit status from the previous execution */
1937-
EG(exit_status) = 0;
1932+
/* Reset exit status from the previous execution */
1933+
EG(exit_status) = 0;
19381934

1939-
php_execute_script(&file_handle);
1935+
php_execute_script(&file_handle);
1936+
}
19401937

19411938
/* Without opcache, or the first time with opcache, the file handle will be placed
19421939
* in the CG(open_files) list by open_file_for_scanning(). Starting from the second

0 commit comments

Comments
 (0)