Oops - fix that fix :-/
[sgt/putty] / rlogin.c
index 15448fc..8010852 100644 (file)
--- a/rlogin.c
+++ b/rlogin.c
@@ -16,11 +16,6 @@ static Socket s = NULL;
 
 static void rlogin_size(void);
 
-static int sb_opt, sb_len;
-static char *sb_buf = NULL;
-static int sb_size = 0;
-#define SB_DELTA 1024
-
 static void c_write(char *buf, int len)
 {
     from_backend(0, buf, len);
@@ -29,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);