svn commit: r301152 - stable/10/lib/libcompat/4.3

Don Lewis truckman at FreeBSD.org
Wed Jun 1 17:41:01 UTC 2016


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) {


More information about the svn-src-all mailing list