]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - rlogin.c
Implement `Restart Session', in both Unix and Windows PuTTY. Largely
[PuTTY.git] / rlogin.c
index 455c2d9d2ba441c3fee1aa2b8477c0a9ff83c2a0..f2b61d27c578f59783f3bade55526338bcc0d94a 100644 (file)
--- a/rlogin.c
+++ b/rlogin.c
@@ -100,7 +100,7 @@ static void rlogin_sent(Plug plug, int bufsize)
 static const char *rlogin_init(void *frontend_handle, void **backend_handle,
                               Config *cfg,
                               char *host, int port, char **realhost,
-                              int nodelay)
+                              int nodelay, int keepalive)
 {
     static const struct plug_function_table fn_table = {
        rlogin_closing,
@@ -130,8 +130,10 @@ static const char *rlogin_init(void *frontend_handle, void **backend_handle,
        sfree(buf);
     }
     addr = name_lookup(host, port, realhost, cfg);
-    if ((err = sk_addr_error(addr)) != NULL)
+    if ((err = sk_addr_error(addr)) != NULL) {
+       sk_addr_free(addr);
        return err;
+    }
 
     if (port < 0)
        port = 513;                    /* default rlogin port */
@@ -147,12 +149,10 @@ static const char *rlogin_init(void *frontend_handle, void **backend_handle,
        sfree(buf);
     }
     rlogin->s = new_connection(addr, *realhost, port, 1, 0,
-                              nodelay, (Plug) rlogin, cfg);
+                              nodelay, keepalive, (Plug) rlogin, cfg);
     if ((err = sk_socket_error(rlogin->s)) != NULL)
        return err;
 
-    sk_addr_free(addr);
-
     /*
      * Send local username, remote username, terminal/speed
      */