projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Correct code to insert into a doubly-linked list.
[u/mdw/putty]
/
mac
/
mtcpnet.c
diff --git
a/mac/mtcpnet.c
b/mac/mtcpnet.c
index
9d40051
..
543caa1
100644
(file)
--- a/
mac/mtcpnet.c
+++ b/
mac/mtcpnet.c
@@
-504,7
+504,8
@@
Socket mactcp_new(SockAddr addr, int port, int privport, int oobinline,
/* Add this to the list of all sockets */
ret->next = mactcp.socklist;
ret->prev = &mactcp.socklist;
- ret->next->prev = &ret->next;
+ if (ret->next != NULL)
+ ret->next->prev = &ret->next;
mactcp.socklist = ret;
return (Socket)ret;