summaryrefslogtreecommitdiffstats
path: root/sbin/fsck
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/fsck')
-rw-r--r--sbin/fsck/fsck.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c
index 13eb9f0..24c4e13 100644
--- a/sbin/fsck/fsck.c
+++ b/sbin/fsck/fsck.c
@@ -543,8 +543,10 @@ getfslab(const char *str)
if ((fd = open(str, O_RDONLY)) == -1)
err(1, "cannot open `%s'", str);
- if (ioctl(fd, DIOCGDINFO, &dl) == -1)
+ if (ioctl(fd, DIOCGDINFO, &dl) == -1) {
+ (void) close(fd);
return(NULL);
+ }
(void) close(fd);
OpenPOWER on IntegriCloud