X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/edcbf00a807b86ea83cca4fa98e854790c4b4a04..f3ab576e6a5f34dfedde93fe236d1eac577628d0:/rlogin.c diff --git a/rlogin.c b/rlogin.c index 3ae18089..80108527 100644 --- a/rlogin.c +++ b/rlogin.c @@ -24,8 +24,10 @@ static void c_write(char *buf, int len) static int rlogin_closing(Plug plug, char *error_msg, int error_code, int calling_back) { - sk_close(s); - s = NULL; + if (s) { + sk_close(s); + s = NULL; + } if (error_msg) { /* A socket error has occurred. */ connection_fatal(error_msg);