From: Simon Tatham Date: Wed, 10 Oct 2012 18:29:16 +0000 (+0000) Subject: A user points out that we should free the 'hProcess' and 'hThread' X-Git-Tag: 0.63~122 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=8e56c52eaaa78b322eec301ea007c093a75cb7dd;p=PuTTY.git A user points out that we should free the 'hProcess' and 'hThread' handles returned in the PROCESS_INFORMATION structure after we call CreateProcess. [originally from svn r9686] --- diff --git a/windows/window.c b/windows/window.c index 85b4699d..5eb1d047 100644 --- a/windows/window.c +++ b/windows/window.c @@ -2156,6 +2156,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, si.lpReserved2 = NULL; CreateProcess(b, cl, NULL, NULL, inherit_handles, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi); + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); if (filemap) CloseHandle(filemap); diff --git a/windows/winproxy.c b/windows/winproxy.c index 8be22eab..75a78529 100644 --- a/windows/winproxy.c +++ b/windows/winproxy.c @@ -206,6 +206,8 @@ Socket platform_new_connection(SockAddr addr, char *hostname, CreateProcess(NULL, cmd, NULL, NULL, TRUE, CREATE_NO_WINDOW | NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi); + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); sfree(cmd);