svn commit: r327570 - head/sbin/newfs_msdos
Warner Losh
imp at FreeBSD.org
Fri Jan 5 05:34:16 UTC 2018
Author: imp
Date: Fri Jan 5 05:34:14 2018
New Revision: 327570
URL: https://svnweb.freebsd.org/changeset/base/327570
Log:
Only call close if fd and fd1 are not -1.
CID: 1384018, 1384017
Modified:
head/sbin/newfs_msdos/mkfs_msdos.c
Modified: head/sbin/newfs_msdos/mkfs_msdos.c
==============================================================================
--- head/sbin/newfs_msdos/mkfs_msdos.c Fri Jan 5 05:02:09 2018 (r327569)
+++ head/sbin/newfs_msdos/mkfs_msdos.c Fri Jan 5 05:34:14 2018 (r327570)
@@ -717,8 +717,10 @@ mkfs_msdos(const char *fname, const char *dtype, const
rv = 0;
done:
free(img);
- close(fd);
- close(fd1);
+ if (fd != -1)
+ close(fd);
+ if (fd1 != -1)
+ close(fd1);
return rv;
}
More information about the svn-src-all
mailing list