From 5e2ae27f2775724eda157b0198d9a46337833225 Mon Sep 17 00:00:00 2001 From: truckman Date: Wed, 25 May 2016 07:26:22 +0000 Subject: 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 --- lib/libcompat/4.3/rexec.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/libcompat/4.3/rexec.c') 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; -- cgit v1.1