diff options
author | dgp <dgp@noemail.net> | 2011-07-12 19:10:13 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2011-07-12 19:10:13 (GMT) |
commit | 67f0f939d95590154e04bb6cbf5c6dbc7968d30f (patch) | |
tree | bc98d7128affe90b9088ae52c8517d5a065591c6 | |
parent | 964cf407742c9599df5a346ce23b50beac10aeb5 (diff) | |
download | tcl-67f0f939d95590154e04bb6cbf5c6dbc7968d30f.zip tcl-67f0f939d95590154e04bb6cbf5c6dbc7968d30f.tar.gz tcl-67f0f939d95590154e04bb6cbf5c6dbc7968d30f.tar.bz2 |
3364777 Stop segfault caused by reading from struct after it had been freed.
FossilOrigin-Name: 69fd1683a00ddac645e7562be2f53d112061ac1c
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | unix/tclUnixSock.c | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2011-07-12 Don Porter <dgp@users.sourceforge.net> + + * generic/tclUnixSock.c: [Bug 3364777] Stop segfault caused by + reading from struct after it had been freed. + 2011-07-11 Joe Mistachkin <joe@mistachkin.com> * generic/tclExecute.c: [Bug 3339502]: Correct cast for CURR_DEPTH to 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); |