diff --git a/unix/uxproxy.c b/unix/uxproxy.c index c1d0c3f5..8e7b76da 100644 --- a/unix/uxproxy.c +++ b/unix/uxproxy.c @@ -88,8 +88,11 @@ Socket *platform_new_connection(SockAddr *addr, const char *hostname, } infd = open(cmd, O_RDONLY); if (infd == -1) { + Socket *toret = new_error_socket_fmt( + plug, "%s: %s", cmd, strerror(errno)); sfree(cmd); - return new_error_socket_fmt(plug, "%s: %s", cmd, strerror(errno)); + close(outfd); + return toret; } sfree(cmd); inerrfd = -1;