aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/fsck
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2009-11-20 15:27:00 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2009-11-20 15:27:00 +0000
commit4b2d15efe507e55615a6f894350f016a52b54368 (patch)
tree09c5c1484390e7ce163aa0e645c976bd641d3969 /sbin/fsck
parent04311706d0ba6ae1fc1759c1d142e4c77378664a (diff)
downloadsrc-4b2d15efe507e55615a6f894350f016a52b54368.tar.gz
src-4b2d15efe507e55615a6f894350f016a52b54368.zip
Fix minor resource leak in a function which was introduced by changing an
err() to a return in r106254. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=199582
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 13eb9f06e067..24c4e13124ae 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);