diff options
author | truckman <truckman@FreeBSD.org> | 2016-05-25 07:26:22 +0000 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2016-05-25 07:26:22 +0000 |
commit | 5e2ae27f2775724eda157b0198d9a46337833225 (patch) | |
tree | d2fec1643c900af3124e6995c04f6b5e18917840 /lib/libcompat | |
parent | f3df1825c6c71de3469c478ce08eea56b01aa019 (diff) | |
download | FreeBSD-src-5e2ae27f2775724eda157b0198d9a46337833225.zip FreeBSD-src-5e2ae27f2775724eda157b0198d9a46337833225.tar.gz |
Fix Coverity CID 978183 Resource leak in rexec().
Close the socket if connect() fails to avoid leaking it.
Reported by: Coverity
CID: 978183
MFC after: 1 week
Diffstat (limited to 'lib/libcompat')
-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 1e37fa2..7999902 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); } port = 0; |