summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2018-10-03 14:32:52 +0200
committerAnatol Belski <ab@php.net>2018-10-03 14:32:52 +0200
commit044eb39e633c91d55b339415ee5749a46496ffd9 (patch)
treef3a4d99ce48dfe06005ea73c2bbc6297b4bc5f9c
parentb0547a3dfba6702e7cc94476d4d422374c20b4b8 (diff)
downloadphp-git-044eb39e633c91d55b339415ee5749a46496ffd9.tar.gz
Avoid code duplication and don't miss env restore
-rw-r--r--sapi/cgi/cgi_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index d571cf02d4..fda24290fc 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -2242,8 +2242,7 @@ consult the installation file that came with this distribution, or visit \n\
while (parent) {
EnterCriticalSection(&cleanup_lock);
if (cleaning_up) {
- DeleteCriticalSection(&cleanup_lock);
- goto parent_out;
+ goto parent_loop_end;
}
LeaveCriticalSection(&cleanup_lock);
@@ -2299,6 +2298,7 @@ consult the installation file that came with this distribution, or visit \n\
WaitForMultipleObjects(kids, kid_cgi_ps, FALSE, INFINITE);
}
+parent_loop_end:
/* restore my env */
SetEnvironmentVariable("PHP_FCGI_CHILDREN", kid_buf);