]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
A user points out that we should free the 'hProcess' and 'hThread'
authorSimon Tatham <anakin@pobox.com>
Wed, 10 Oct 2012 18:29:16 +0000 (18:29 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 10 Oct 2012 18:29:16 +0000 (18:29 +0000)
handles returned in the PROCESS_INFORMATION structure after we call
CreateProcess.

[originally from svn r9686]

windows/window.c
windows/winproxy.c

index 85b4699d7f455b5b7c2f8e13bdfbd85661f0fe80..5eb1d047ee6e210d85827e3619b87520f5942501 100644 (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);
index 8be22eabfd612209d88f3479eb05366bdc45d367..75a785296ac4dba5e294509d33a97799301c7de5 100644 (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);