about summary refs log tree commit diff
path: root/Src/Modules/tcp.c
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 /Src/Modules/tcp.c
parent88164bc45ace404a6f329b77cf08ca37deffab66 (diff)
downloadzsh-8c47be28f9582d153fcd59d8370ad44d006b4b03.tar.gz
zsh-8c47be28f9582d153fcd59d8370ad44d006b4b03.tar.xz
zsh-8c47be28f9582d153fcd59d8370ad44d006b4b03.zip
17097: closing all TCP sessions referenced freed memory.
Diffstat (limited to 'Src/Modules/tcp.c')
-rw-r--r--Src/Modules/tcp.c6
1 files changed, 4 insertions, 2 deletions
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));
+    }
 }
 
 /**/