summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2009-11-20 15:27:00 +0000
committernetchild <netchild@FreeBSD.org>2009-11-20 15:27:00 +0000
commit42a48ae275cdb2d5513274f18028bd192ba0f48b (patch)
tree09c5c1484390e7ce163aa0e645c976bd641d3969 /sbin
parente838e3bb4e471ef641812698d80c8438cf4cf74d (diff)
downloadFreeBSD-src-42a48ae275cdb2d5513274f18028bd192ba0f48b.zip
FreeBSD-src-42a48ae275cdb2d5513274f18028bd192ba0f48b.tar.gz
Fix minor resource leak in a function which was introduced by changing an
err() to a return in r106254. MFC after: 1 week
Diffstat (limited to 'sbin')
-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