Only call close if fd and fd1 are not -1.
CID: 1384018, 1384017
This commit is contained in:
parent
b98c751962
commit
783d8ed04e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327570
@ -717,8 +717,10 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
rv = 0;
|
||||
done:
|
||||
free(img);
|
||||
close(fd);
|
||||
close(fd1);
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
if (fd1 != -1)
|
||||
close(fd1);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user