Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jun 2016 17:41:00 +0000 (UTC)
From:      Don Lewis <truckman@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r301152 - stable/10/lib/libcompat/4.3
Message-ID:  <201606011741.u51Hf0hL056529@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: truckman
Date: Wed Jun  1 17:41:00 2016
New Revision: 301152
URL: https://svnweb.freebsd.org/changeset/base/301152

Log:
  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

Modified:
  stable/10/lib/libcompat/4.3/rexec.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libcompat/4.3/rexec.c
==============================================================================
--- stable/10/lib/libcompat/4.3/rexec.c	Wed Jun  1 17:39:03 2016	(r301151)
+++ stable/10/lib/libcompat/4.3/rexec.c	Wed Jun  1 17:41:00 2016	(r301152)
@@ -330,6 +330,7 @@ retry:
 			goto retry;
 		}
 		perror(hp->h_name);
+		(void) close(s);
 		return (-1);
 	}
 	if (fd2p == 0) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606011741.u51Hf0hL056529>