X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/edcbf00a807b86ea83cca4fa98e854790c4b4a04..f3ab576e6a5f34dfedde93fe236d1eac577628d0:/ssh.c diff --git a/ssh.c b/ssh.c index 45354884..e2c2d737 100644 --- a/ssh.c +++ b/ssh.c @@ -1478,8 +1478,10 @@ static int ssh_closing(Plug plug, char *error_msg, int error_code, int calling_back) { ssh_state = SSH_STATE_CLOSED; - sk_close(s); - s = NULL; + if (s) { + sk_close(s); + s = NULL; + } if (error_msg) { /* A socket error has occurred. */ connection_fatal(error_msg);