diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b731ef181..508961d90 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2009-07-06 Christopher Faylor + + * cygtls.cc (_cygtls::remove): Avoid closing a NULL handle. + 2009-07-06 Corinna Vinschen * fhandler_socket.cc (fhandler_socket::recv_internal): Convert wsabuf diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index 16743af46..c154465e4 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -150,7 +150,8 @@ _cygtls::remove (DWORD wait) select to control this themselves. */ if (!locals.select.sockevt) { - CloseHandle (locals.select.sockevt); + if (locals.select.sockevt) + CloseHandle (locals.select.sockevt); locals.select.sockevt = NULL; free_local (select.ser_num); free_local (select.w4);