sbin/newfs_hammer: Fix minor memory leak
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Wed, 19 Aug 2015 12:03:13 +0000 (21:03 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 22 Aug 2015 15:48:29 +0000 (00:48 +0900)
vol->fd is supposed to be already opened by setup_volume()
by the time check_volume(vol) is called.

sbin/newfs_hammer/newfs_hammer.c

index 4e7279e..21f53e1 100644 (file)
@@ -442,9 +442,6 @@ check_volume(struct volume_info *vol)
        /*
         * Get basic information about the volume
         */
-       vol->fd = open(vol->name, O_RDWR);
-       if (vol->fd < 0)
-               err(1, "Unable to open %s R+W", vol->name);
        if (ioctl(vol->fd, DIOCGPART, &pinfo) < 0) {
                /*
                 * Allow the formatting of regular files as HAMMER volumes