Skip to content

Commit f89d84d

Browse files
committed
Better leak fix for cgi -s / -w
We also need to go through request shutdown. The naming is a bit confusing, but it's fine to go through fastcgi_request_done even if not using fastcgi. Whether we loop or not is checked separately.
1 parent 1314ccb commit f89d84d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

sapi/cgi/cgi_main.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,22 +2568,16 @@ consult the installation file that came with this distribution, or visit \n\
25682568
case PHP_MODE_STRIP:
25692569
if (open_file_for_scanning(&file_handle) == SUCCESS) {
25702570
zend_strip();
2571-
zend_file_handle_dtor(&file_handle);
25722571
}
2573-
goto parent_out;
2572+
break;
25742573
case PHP_MODE_HIGHLIGHT:
25752574
{
25762575
zend_syntax_highlighter_ini syntax_highlighter_ini;
25772576

25782577
if (open_file_for_scanning(&file_handle) == SUCCESS) {
25792578
php_get_highlight_struct(&syntax_highlighter_ini);
25802579
zend_highlight(&syntax_highlighter_ini);
2581-
if (fastcgi) {
2582-
goto fastcgi_request_done;
2583-
}
2584-
zend_file_handle_dtor(&file_handle);
25852580
}
2586-
goto parent_out;
25872581
}
25882582
break;
25892583
}

0 commit comments

Comments
 (0)