From: Anatol Belski Date: Wed, 3 Oct 2018 12:32:52 +0000 (+0200) Subject: Avoid code duplication and don't miss env restore X-Git-Tag: php-7.1.24RC1~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=044eb39e633c91d55b339415ee5749a46496ffd9;p=php Avoid code duplication and don't miss env restore --- 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);