summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-07-12 19:10:13 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-07-12 19:10:13 (GMT)
commit02ef1632d034f070d79c64264efa65fce9fc5af7 (patch)
treebc98d7128affe90b9088ae52c8517d5a065591c6 /unix
parenta794c019fc0416aa27cb0dde1889e3486725aa4c (diff)
downloadtcl-02ef1632d034f070d79c64264efa65fce9fc5af7.zip
tcl-02ef1632d034f070d79c64264efa65fce9fc5af7.tar.gz
tcl-02ef1632d034f070d79c64264efa65fce9fc5af7.tar.bz2
3364777 Stop segfault caused by reading from struct after it had been freed.
Diffstat (limited to 'unix')
-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);