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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to