]> granicus.if.org Git - php/commitdiff
Avoid code duplication and don't miss env restore
authorAnatol Belski <ab@php.net>
Wed, 3 Oct 2018 12:32:52 +0000 (14:32 +0200)
committerAnatol Belski <ab@php.net>
Wed, 3 Oct 2018 12:32:52 +0000 (14:32 +0200)
sapi/cgi/cgi_main.c

index d571cf02d4439770efebaa0734b6392d3bac480e..fda24290fc7a41891e959cf71924249c5d190a7f 100644 (file)
@@ -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);