umask_open: don't leak fd on success
MFC after: 3 days Reported by: Coverity CID: 978315
This commit is contained in:
parent
358e989f83
commit
ab25ecadbf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=311239
@ -129,6 +129,9 @@ ATF_TC_BODY(umask_open, tc)
|
||||
if (fd < 0)
|
||||
continue;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
(void)close(fd);
|
||||
#endif
|
||||
(void)memset(&st, 0, sizeof(struct stat));
|
||||
|
||||
if (stat(path, &st) != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user