From: Bill Stoddard Date: Mon, 11 Feb 2002 15:46:44 +0000 (+0000) Subject: Win32: Handles returned by GetStdHandle are psuedo handles and should never be X-Git-Tag: 2.0.33~304 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8cbea60c02e18354bcd2b8603eef5a2a74ef9f15;p=apache Win32: Handles returned by GetStdHandle are psuedo handles and should never be passed to a CloseHandle call. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93361 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 1a954bf137..d08c7447a7 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -1600,7 +1600,12 @@ static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_ CloseHandle(pi.hThread); CloseHandle(hPipeRead); CloseHandle(hNullOutput); - CloseHandle(hShareError); + if (GetStdHandle(STD_ERROR_HANDLE) != hShareError) { + /* Handles opened with GetStdHandle are psuedo handles + * and should not be closed else bad things will happen. + */ + CloseHandle(hShareError); + } _putenv("AP_PARENT_PID="); _putenv("AP_MY_GENERATION=");