From 2506a26ab42b75c483ab0b3318bfae59b52861b1 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 11 Jan 2003 17:36:24 +0000 Subject: [PATCH] Calling plug_closing() is highly likely to result in a call to sk_close(), so arrange that mactcp_poll() can cope with that and not access freed memory when it happens. [originally from svn r2545] --- mac/mtcpnet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mac/mtcpnet.c b/mac/mtcpnet.c index bd630878..54ca10ca 100644 --- a/mac/mtcpnet.c +++ b/mac/mtcpnet.c @@ -603,11 +603,11 @@ static pascal void mactcp_asr(StreamPtr str, unsigned short event, Ptr cookie, */ void mactcp_poll(void) { - Actual_Socket s; + Actual_Socket s, next; TCPiopb pb; - for (s = mactcp.socklist; s != NULL; s = s->next) { - /* XXX above can't handle sockets being deleted. */ + for (s = mactcp.socklist; s != NULL; s = next) { + next = s->next; do { pb.ioCRefNum = mactcp.refnum; pb.csCode = TCPStatus; -- 2.45.2