summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixSock.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tclUnixSock.c')
-rw-r--r--unix/tclUnixSock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 52b089c..f302b70 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -544,8 +544,11 @@ TcpCloseProc(
}
}
- for (fds = statePtr->fds.next; fds != NULL; fds = fds->next) {
+ fds = statePtr->fds.next;
+ while (fds != NULL) {
+ TcpFdList *next = fds->next;
ckfree(fds);
+ fds = next;
}
if (statePtr->addrlist != NULL) {
freeaddrinfo(statePtr->addrlist);