summaryrefslogtreecommitdiffstats
path: root/lib/libcompat
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2016-06-01 17:41:00 +0000
committertruckman <truckman@FreeBSD.org>2016-06-01 17:41:00 +0000
commitaa1356cf2436c7695cc65a5a27bc635c22c21761 (patch)
treec84d6bef82f79dd15d724a38027231e494c19805 /lib/libcompat
parentfa7d0f23a5adc1d2f858496ce03e3c066f8a0e91 (diff)
downloadFreeBSD-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
Diffstat (limited to 'lib/libcompat')
-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 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) {
OpenPOWER on IntegriCloud