Author: ngie
Date: Wed Jan  4 04:27:13 2017
New Revision: 311246
URL: https://svnweb.freebsd.org/changeset/base/311246

Log:
  fexecve: don't leak fd on fexecve(2) failure; close before calling err
  
  MFC after:    3 days
  Reported by:  Coverity
  CID:          978285

Modified:
  head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c

Modified: head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c Wed Jan  4 04:19:05 
2017        (r311245)
+++ head/contrib/netbsd-tests/lib/libc/c063/t_fexecve.c Wed Jan  4 04:27:13 
2017        (r311246)
@@ -70,6 +70,9 @@ ATF_TC_BODY(fexecve, tc)
                                error = 76;
                        else
                                error = EXIT_FAILURE;
+#ifdef __FreeBSD__
+                       (void)close(fd);
+#endif
                        err(error, "fexecve");
                }
        }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to