Skip to content

Commit 4e279fe

Browse files
committed
Cygwin: pty: Add missing DeleteProcThreadAttributeList() call
Currently, the cleanup path of setup_pseudoconsole() is missing DeleteProcThreadAttributeList() call, while microsoft's document requires that and the normal path has it. https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-initializeprocthreadattributelist This patch adds DeleteProcThreadAttributeList() call to the cleanup path. Fixes: bb42852 ("Cygwin: pty: Implement new pseudo console support.") Suggested-by: Johannes Schindelin <[email protected]> Signed-off-by: Takashi Yano <[email protected]> Reviewed-by: Corinna Vinschen <[email protected]> (cherry picked from commit 11a835f)
1 parent a8a61d8 commit 4e279fe

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

winsup/cygwin/fhandler/pty.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3530,7 +3530,7 @@ fhandler_pty_slave::setup_pseudoconsole ()
35303530
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE,
35313531
hpcon, sizeof (hpcon), NULL, NULL))
35323532

3533-
goto cleanup_heap;
3533+
goto cleanup_proc_thread_attr;
35343534

35353535
hello = CreateEvent (&sec_none, true, false, NULL);
35363536
goodbye = CreateEvent (&sec_none, true, false, NULL);
@@ -3699,6 +3699,8 @@ fhandler_pty_slave::setup_pseudoconsole ()
36993699
CloseHandle (goodbye);
37003700
CloseHandle (hr);
37013701
CloseHandle (hw);
3702+
cleanup_proc_thread_attr:
3703+
DeleteProcThreadAttributeList (si.lpAttributeList);
37023704
cleanup_heap:
37033705
HeapFree (GetProcessHeap (), 0, si.lpAttributeList);
37043706
cleanup_pseudo_console:

0 commit comments

Comments
 (0)