mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-21 14:18:38 -05: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:
parent
74902c6966
commit
8e56c52eaa
@ -2156,6 +2156,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
si.lpReserved2 = NULL;
|
si.lpReserved2 = NULL;
|
||||||
CreateProcess(b, cl, NULL, NULL, inherit_handles,
|
CreateProcess(b, cl, NULL, NULL, inherit_handles,
|
||||||
NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);
|
NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);
|
||||||
|
CloseHandle(pi.hProcess);
|
||||||
|
CloseHandle(pi.hThread);
|
||||||
|
|
||||||
if (filemap)
|
if (filemap)
|
||||||
CloseHandle(filemap);
|
CloseHandle(filemap);
|
||||||
|
@ -206,6 +206,8 @@ Socket platform_new_connection(SockAddr addr, char *hostname,
|
|||||||
CreateProcess(NULL, cmd, NULL, NULL, TRUE,
|
CreateProcess(NULL, cmd, NULL, NULL, TRUE,
|
||||||
CREATE_NO_WINDOW | NORMAL_PRIORITY_CLASS,
|
CREATE_NO_WINDOW | NORMAL_PRIORITY_CLASS,
|
||||||
NULL, NULL, &si, &pi);
|
NULL, NULL, &si, &pi);
|
||||||
|
CloseHandle(pi.hProcess);
|
||||||
|
CloseHandle(pi.hThread);
|
||||||
|
|
||||||
sfree(cmd);
|
sfree(cmd);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user