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]);