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
@ -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