From 705d704153cf2352205b7f481473971f9eda8073 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 4 Nov 2011 16:52:43 +0000 Subject: [PATCH] * sigproc.cc (child_info_spawn::reattach_children): Clean up handle when can't open parent process or suffer handle leak. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/sigproc.cc | 2 ++ 2 files changed, 7 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9f8c0fcfc..ca1fc5314 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2011-11-04 Christopher Faylor + + * sigproc.cc (child_info_spawn::reattach_children): Clean up handle + when can't open parent process or suffer handle leak. + 2011-11-03 Christopher Faylor * sigproc.cc (child_info::sync): Report on exit code in strace output. diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index dcb52733b..a3035d9ca 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -868,6 +868,8 @@ child_info_spawn::reattach_children () children[i].rd_proc_pipe); else if ((p.hProcess = OpenProcess (PROCESS_QUERY_INFORMATION, false, p->pid))) p.reattach (); + else + CloseHandle (p.rd_proc_pipe); } }