]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Two more memory leak fixes, on error paths I didn't spot in r9919.
authorSimon Tatham <anakin@pobox.com>
Sun, 21 Jul 2013 07:40:26 +0000 (07:40 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 21 Jul 2013 07:40:26 +0000 (07:40 +0000)
[originally from svn r9948]
[r9919 == ea301bdd9b892a5e70692f82f5c0b98bd585e775]

portfwd.c
unix/uxproxy.c

index 97c1cb74071a6af56657604c7ffd30d2b5ca4cbb..264198fb2129299806be52a0cb0b359d61ec05df 100644 (file)
--- a/portfwd.c
+++ b/portfwd.c
@@ -370,6 +370,7 @@ const char *pfd_newconnect(Socket *s, char *hostname, int port,
     addr = name_lookup(hostname, port, &dummy_realhost, conf, addressfamily);
     if ((err = sk_addr_error(addr)) != NULL) {
        sk_addr_free(addr);
+        sfree(dummy_realhost);
        return err;
     }
 
index aa1ff07ab2bdb72e405a102ac3ec41a8a35086e8..f808a67796c66cf3f6c37e99fdd241b788eac582 100644 (file)
@@ -288,6 +288,7 @@ Socket platform_new_connection(SockAddr addr, char *hostname,
     if (pipe(to_cmd_pipe) < 0 ||
        pipe(from_cmd_pipe) < 0) {
        ret->error = dupprintf("pipe: %s", strerror(errno));
+        sfree(cmd);
        return (Socket)ret;
     }
     cloexec(to_cmd_pipe[1]);