From 08d46fca517e292ae1671c4daa994af99d8c0a1d Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 21 Jul 2013 07:40:26 +0000 Subject: [PATCH] Two more memory leak fixes, on error paths I didn't spot in r9919. [originally from svn r9948] [r9919 == ea301bdd9b892a5e70692f82f5c0b98bd585e775] --- portfwd.c | 1 + unix/uxproxy.c | 1 + 2 files changed, 2 insertions(+) diff --git a/portfwd.c b/portfwd.c index 97c1cb74..264198fb 100644 --- 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; } diff --git a/unix/uxproxy.c b/unix/uxproxy.c index aa1ff07a..f808a677 100644 --- a/unix/uxproxy.c +++ b/unix/uxproxy.c @@ -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]);