Two more memory leak fixes, on error paths I didn't spot in r9919.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 21 Jul 2013 07:40:26 +0000 (07:40 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 21 Jul 2013 07:40:26 +0000 (07:40 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@9948 cda61777-01e9-0310-a592-d414129be87e

portfwd.c
unix/uxproxy.c

index 97c1cb7..264198f 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 aa1ff07..f808a67 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]);