Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Dec 2017 05:34:19 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327275 - head/sbin/newfs_msdos
Message-ID:  <201712280534.vBS5YJ8F024741@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Dec 28 05:34:19 2017
New Revision: 327275
URL: https://svnweb.freebsd.org/changeset/base/327275

Log:
  Close fd and fd1 before returning now that we're done with them.
  
  CID: 978234, 978236

Modified:
  head/sbin/newfs_msdos/mkfs_msdos.c

Modified: head/sbin/newfs_msdos/mkfs_msdos.c
==============================================================================
--- head/sbin/newfs_msdos/mkfs_msdos.c	Thu Dec 28 05:34:14 2017	(r327274)
+++ head/sbin/newfs_msdos/mkfs_msdos.c	Thu Dec 28 05:34:19 2017	(r327275)
@@ -247,6 +247,7 @@ mkfs_msdos(const char *fname, const char *dtype, const
 
     img = NULL;
     rv = -1;
+    fd = fd1 = -1;
 
     if (o.block_size && o.sectors_per_cluster) {
 	warnx("Cannot specify both block size and sectors per cluster");
@@ -716,6 +717,8 @@ mkfs_msdos(const char *fname, const char *dtype, const
     rv = 0;
 done:
     free(img);
+    close(fd);
+    close(fd1);
 
     return rv;
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712280534.vBS5YJ8F024741>