1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

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]
This commit is contained in:
Simon Tatham 2012-10-10 18:29:16 +00:00
parent 74902c6966
commit 8e56c52eaa
2 changed files with 4 additions and 0 deletions

View File

@ -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);

View File

@ -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);