Module Name:    src
Committed By:   christos
Date:           Fri Jan 13 19:34:19 UTC 2017

Modified Files:
        src/tests/lib/libc/sys: t_umask.c

Log Message:
PR/51843: Ngie Cooper: don't leak file descriptor


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_umask.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_umask.c
diff -u src/tests/lib/libc/sys/t_umask.c:1.1 src/tests/lib/libc/sys/t_umask.c:1.2
--- src/tests/lib/libc/sys/t_umask.c:1.1	Thu Jul  7 02:57:54 2011
+++ src/tests/lib/libc/sys/t_umask.c	Fri Jan 13 14:34:19 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_umask.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $ */
+/* $NetBSD: t_umask.c,v 1.2 2017/01/13 19:34:19 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_umask.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $");
+__RCSID("$NetBSD: t_umask.c,v 1.2 2017/01/13 19:34:19 christos Exp $");
 
 #include <sys/stat.h>
 #include <sys/wait.h>
@@ -129,6 +129,7 @@ ATF_TC_BODY(umask_open, tc)
 		if (fd < 0)
 			continue;
 
+		(void)close(fd);
 		(void)memset(&st, 0, sizeof(struct stat));
 
 		if (stat(path, &st) != 0) {

Reply via email to