[newlib-cygwin/cygwin-3_6-branch] Cygwin: pty: Add missing DeleteProcThreadAttributeList() call
Takashi Yano
tyan0@sourceware.org
Wed Apr 15 00:50:57 GMT 2026
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4e279febca2443ce9f6a92b1ea7b095ea47b53bf
commit 4e279febca2443ce9f6a92b1ea7b095ea47b53bf
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date: Tue Apr 7 19:21:05 2026 +0900
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: bb4285206207 ("Cygwin: pty: Implement new pseudo console support.")
Suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
(cherry picked from commit 11a835fbe481018f7c50cee25e109df558da7ec2)
Diff:
---
winsup/cygwin/fhandler/pty.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler/pty.cc b/winsup/cygwin/fhandler/pty.cc
index 7b000fe8d..4c10ae32d 100644
--- a/winsup/cygwin/fhandler/pty.cc
+++ b/winsup/cygwin/fhandler/pty.cc
@@ -3530,7 +3530,7 @@ fhandler_pty_slave::setup_pseudoconsole ()
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE,
hpcon, sizeof (hpcon), NULL, NULL))
- goto cleanup_heap;
+ goto cleanup_proc_thread_attr;
hello = CreateEvent (&sec_none, true, false, NULL);
goodbye = CreateEvent (&sec_none, true, false, NULL);
@@ -3699,6 +3699,8 @@ skip_close_hello:
CloseHandle (goodbye);
CloseHandle (hr);
CloseHandle (hw);
+cleanup_proc_thread_attr:
+ DeleteProcThreadAttributeList (si.lpAttributeList);
cleanup_heap:
HeapFree (GetProcessHeap (), 0, si.lpAttributeList);
cleanup_pseudo_console:
More information about the Cygwin-cvs
mailing list