summaryrefslogtreecommitdiffstats
path: root/lib/libcompat/4.3/rexec.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2016-05-25 07:26:22 +0000
committertruckman <truckman@FreeBSD.org>2016-05-25 07:26:22 +0000
commit5e2ae27f2775724eda157b0198d9a46337833225 (patch)
treed2fec1643c900af3124e6995c04f6b5e18917840 /lib/libcompat/4.3/rexec.c
parentf3df1825c6c71de3469c478ce08eea56b01aa019 (diff)
downloadFreeBSD-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/4.3/rexec.c')
-rw-r--r--lib/libcompat/4.3/rexec.c1
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;
OpenPOWER on IntegriCloud