]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - telnet.c
Add missing null-pointer checks in key exchange.
[PuTTY.git] / telnet.c
index 3536414c1085194ce3e2f135652a10d1b29ab68b..098db292cc05a0c9a64e50db80ecf04954f78a71 100644 (file)
--- a/telnet.c
+++ b/telnet.c
@@ -662,6 +662,7 @@ static void telnet_log(Plug plug, int type, SockAddr addr, int port,
        msg = dupprintf("Failed to connect to %s: %s", addrbuf, error_msg);
 
     logevent(telnet->frontend, msg);
+    sfree(msg);
 }
 
 static int telnet_closing(Plug plug, const char *error_msg, int error_code,
@@ -817,15 +818,10 @@ static const char *telnet_init(void *frontend_handle, void **backend_handle,
 
        sfree(*realhost);
        *realhost = dupstr(loghost);
-       colon = strrchr(*realhost, ':');
-       if (colon) {
-           /*
-            * FIXME: if we ever update this aspect of ssh.c for
-            * IPv6 literal management, this should change in line
-            * with it.
-            */
+
+       colon = host_strrchr(*realhost, ':');
+       if (colon)
            *colon++ = '\0';
-       }
     }
 
     return NULL;