X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxproxy.c;h=f808a67796c66cf3f6c37e99fdd241b788eac582;hb=0cc6fb8bfea07360afeac83ba67aceffb56499c8;hp=9dee690e1d9c934c8eabeb97931081450000b39a;hpb=ea301bdd9b892a5e70692f82f5c0b98bd585e775;p=PuTTY.git diff --git a/unix/uxproxy.c b/unix/uxproxy.c index 9dee690e..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]); @@ -306,8 +307,8 @@ Socket platform_new_connection(SockAddr addr, char *hostname, dup2(from_cmd_pipe[1], 1); close(to_cmd_pipe[0]); close(from_cmd_pipe[1]); - fcntl(0, F_SETFD, 0); - fcntl(1, F_SETFD, 0); + noncloexec(0); + noncloexec(1); execl("/bin/sh", "sh", "-c", cmd, (void *)NULL); _exit(255); }