mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-10 15:48:06 -05:00
Reliably initialise uxnet's socket fd fields to -1.
This prevents embarrassing mess-ups involving getting back a Socket which has mostly been memset to 0 but contains an error message, sk_close()ing it to free the memory, and finding that standard input has been closed as a side effect. [originally from svn r10073]
This commit is contained in:
parent
6f6e9db932
commit
489590cbd4
@ -799,6 +799,7 @@ Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i
|
||||
ret->incomingeof = FALSE;
|
||||
ret->listener = 1;
|
||||
ret->addr = NULL;
|
||||
ret->s = -1;
|
||||
|
||||
/*
|
||||
* Translate address_family from platform-independent constants
|
||||
@ -1544,6 +1545,7 @@ Socket new_unix_listener(SockAddr listenaddr, Plug plug)
|
||||
ret->incomingeof = FALSE;
|
||||
ret->listener = 1;
|
||||
ret->addr = listenaddr;
|
||||
ret->s = -1;
|
||||
|
||||
assert(listenaddr->superfamily == UNIX);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user