Skip to content

Commit 4c3505e

Browse files
committed
Remove wrong CloseHandle() call.
In accordance with its own documentation, invoke CloseHandle() only when directed in the documentation for the function that furnished the handle. GetModuleHandle() does not so direct. We have been issuing this call only in the rare event that a CRT DLL contains no "_putenv" symbol, so lack of bug reports is uninformative. Back-patch to 9.2 (all supported versions). Christian Ullrich, reviewed by Michael Paquier.
1 parent 2d60d92 commit 4c3505e

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/port/win32env.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ pgwin32_putenv(const char *envval)
8989
rtmodules[i].putenvFunc = (PUTENVPROC) GetProcAddress(rtmodules[i].hmodule, "_putenv");
9090
if (rtmodules[i].putenvFunc == NULL)
9191
{
92-
CloseHandle(rtmodules[i].hmodule);
9392
rtmodules[i].hmodule = INVALID_HANDLE_VALUE;
9493
continue;
9594
}

0 commit comments

Comments
 (0)