svn commit: r300664 - head/lib/libcompat/4.3

Don Lewis truckman at FreeBSD.org
Wed May 25 07:26:23 UTC 2016


Author: truckman
Date: Wed May 25 07:26:22 2016
New Revision: 300664
URL: https://svnweb.freebsd.org/changeset/base/300664

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

Modified:
  head/lib/libcompat/4.3/rexec.c

Modified: head/lib/libcompat/4.3/rexec.c
==============================================================================
--- head/lib/libcompat/4.3/rexec.c	Wed May 25 07:14:52 2016	(r300663)
+++ head/lib/libcompat/4.3/rexec.c	Wed May 25 07:26:22 2016	(r300664)
@@ -330,6 +330,7 @@ retry:
 			goto retry;
 		}
 		perror(hp->h_name);
+		(void) close(s);
 		return (-1);
 	}
 	port = 0;


More information about the svn-src-head mailing list