Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc/sys PR/51843: Ngie Cooper: don't leak file de...
details: https://anonhg.NetBSD.org/src/rev/3d2a114fea12
branches: trunk
changeset: 350549:3d2a114fea12
user: christos <christos%NetBSD.org@localhost>
date: Fri Jan 13 19:34:19 2017 +0000
description:
PR/51843: Ngie Cooper: don't leak file descriptor
diffstat:
tests/lib/libc/sys/t_umask.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (26 lines):
diff -r b7414333df27 -r 3d2a114fea12 tests/lib/libc/sys/t_umask.c
--- a/tests/lib/libc/sys/t_umask.c Fri Jan 13 19:33:10 2017 +0000
+++ b/tests/lib/libc/sys/t_umask.c Fri Jan 13 19:34:19 2017 +0000
@@ -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 @@
if (fd < 0)
continue;
+ (void)close(fd);
(void)memset(&st, 0, sizeof(struct stat));
if (stat(path, &st) != 0) {
Home |
Main Index |
Thread Index |
Old Index