NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/51843: [PATCH] tests/lib/libc/sys/t_umask: don't leak file descriptor



The following reply was made to PR bin/51843; it has been noted by GNATS.

From: "Ngie Cooper (yaneurabeya)" <yaneurabeya%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/51843: [PATCH] tests/lib/libc/sys/t_umask: don't leak file
 descriptor
Date: Thu, 12 Jan 2017 21:05:15 -0800

 --Apple-Mail=_6B6D8386-14ED-4995-9A6D-15B40234652D
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 Patch attached.
 -Ngie
 
 --Apple-Mail=_6B6D8386-14ED-4995-9A6D-15B40234652D
 Content-Disposition: attachment;
 	filename=t_umask-dont-leak-fd.patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="t_umask-dont-leak-fd.patch"
 Content-Transfer-Encoding: 7bit
 
 Index: lib/libc/sys/t_umask.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/sys/t_umask.c,v
 retrieving revision 1.1
 diff -u -r1.1 t_umask.c
 --- lib/libc/sys/t_umask.c	7 Jul 2011 06:57:54 -0000	1.1
 +++ lib/libc/sys/t_umask.c	13 Jan 2017 05:04:56 -0000
 @@ -129,6 +129,7 @@
  		if (fd < 0)
  			continue;
  
 +		(void)close(fd);
  		(void)memset(&st, 0, sizeof(struct stat));
  
  		if (stat(path, &st) != 0) {
 
 --Apple-Mail=_6B6D8386-14ED-4995-9A6D-15B40234652D--
 


Home | Main Index | Thread Index | Old Index