diff options
author | truckman <truckman@FreeBSD.org> | 2016-06-01 17:41:00 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2016-06-01 17:41:00 +0000 |
commit | aa1356cf2436c7695cc65a5a27bc635c22c21761 (patch) | |
tree | c84d6bef82f79dd15d724a38027231e494c19805 | |
parent | fa7d0f23a5adc1d2f858496ce03e3c066f8a0e91 (diff) | |
download | FreeBSD-src-aa1356cf2436c7695cc65a5a27bc635c22c21761.zip FreeBSD-src-aa1356cf2436c7695cc65a5a27bc635c22c21761.tar.gz |
MFC r300664
Fix Coverity CID 978183 Resource leak in rexec().
Close the socket if connect() fails to avoid leaking it.
Reported by: Coverity
CID: 978183
-rw-r--r-- | lib/libcompat/4.3/rexec.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libcompat/4.3/rexec.c b/lib/libcompat/4.3/rexec.c index 4e01eb6..3a8b452 100644 --- a/lib/libcompat/4.3/rexec.c +++ b/lib/libcompat/4.3/rexec.c @@ -330,6 +330,7 @@ retry: goto retry; } perror(hp->h_name); + (void) close(s); return (-1); } if (fd2p == 0) { |