about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-05-08 15:54:05 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-05-08 15:54:05 +0000
commit8c47be28f9582d153fcd59d8370ad44d006b4b03 (patch)
tree8ac3b809814aaf60ec043b74934fc24c6584beef
parent88164bc45ace404a6f329b77cf08ca37deffab66 (diff)
downloadzsh-8c47be28f9582d153fcd59d8370ad44d006b4b03.tar.gz
zsh-8c47be28f9582d153fcd59d8370ad44d006b4b03.tar.xz
zsh-8c47be28f9582d153fcd59d8370ad44d006b4b03.zip
17097: closing all TCP sessions referenced freed memory.
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/tcp.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 56d97b3b2..4f36c5013 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2002-05-08  Peter Stephenson  <pws@csr.com>
 
+	* 17097: Src/Modules/tcp.c: closing all TCP sessions referenced
+	freed memory.
+
 	* Unposted: Src/Modules/zselect.c: remove an unused counter.
 
 	* 17095: Src/Modules/zselect.c: wrong index when appending to a
diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c
index 5f5f432c6..e00e220b5 100644
--- a/Src/Modules/tcp.c
+++ b/Src/Modules/tcp.c
@@ -279,10 +279,12 @@ zts_byfd(int fd)
 static void
 tcp_cleanup(void)
 {
-    LinkNode node;
+    LinkNode node, next;
 
-    for (node = firstnode(ztcp_sessions); node; incnode(node))
+    for (node = firstnode(ztcp_sessions); node; node = next) {
+	next = node->next;
 	tcp_close((Tcp_session)getdata(node));
+    }
 }
 
 /**/