diff options
author | netchild <netchild@FreeBSD.org> | 2009-11-20 15:27:00 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2009-11-20 15:27:00 +0000 |
commit | 42a48ae275cdb2d5513274f18028bd192ba0f48b (patch) | |
tree | 09c5c1484390e7ce163aa0e645c976bd641d3969 /sbin | |
parent | e838e3bb4e471ef641812698d80c8438cf4cf74d (diff) | |
download | FreeBSD-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.c | 4 |
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); |