From e6e220f14d2d0b998a5e2e1977116a701371a88f Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 22 May 2012 15:11:01 +0000 Subject: Avoid calling close() on a bogus fd when an attempt to open a client socket with an unsupported address family leaves one behind. --- unix/tclUnixSock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index e48cc2b..12e5a9a 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -545,6 +545,9 @@ TcpCloseProc( */ for (fds = &statePtr->fds; fds != NULL; fds = fds->next) { + if (fds->fd < 0) { + continue; + } Tcl_DeleteFileHandler(fds->fd); if (close(fds->fd) < 0) { errorCode = errno; -- cgit v0.12