1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Set SSH socket variable to NULL if connect() fails. Failure to do

this was causing PSCP to hang indefinitely after reporting
Connection Refused.

[originally from svn r1569]
This commit is contained in:
Simon Tatham 2002-02-27 22:45:52 +00:00
parent 84c3ece865
commit ae7c314f33

4
ssh.c
View File

@ -1873,8 +1873,10 @@ static char *connect_to_host(char *host, int port, char **realhost, int nodelay)
logevent(buf);
}
s = sk_new(addr, port, 0, 1, nodelay, &fn_table_ptr);
if ((err = sk_socket_error(s)))
if ((err = sk_socket_error(s))) {
s = NULL;
return err;
}
#ifdef FWHACK
sk_write(s, "connect ", 8);