aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/boot0cfg
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2011-11-23 10:27:18 +0000
committerKevin Lo <kevlo@FreeBSD.org>2011-11-23 10:27:18 +0000
commitde028133d41eb4da01c689c205164eeb060573ad (patch)
tree0f2f3e671dd7714749793d35d1d678111be67f3b /usr.sbin/boot0cfg
parent85df37918418c7096d4997fa03a0b505f5c4ab52 (diff)
downloadsrc-de028133d41eb4da01c689c205164eeb060573ad.tar.gz
src-de028133d41eb4da01c689c205164eeb060573ad.zip
Plug fd leaks
Notes
Notes: svn path=/head/; revision=227876
Diffstat (limited to 'usr.sbin/boot0cfg')
-rw-r--r--usr.sbin/boot0cfg/boot0cfg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/boot0cfg/boot0cfg.c b/usr.sbin/boot0cfg/boot0cfg.c
index 72baf4690d0e..935f85b5998d 100644
--- a/usr.sbin/boot0cfg/boot0cfg.c
+++ b/usr.sbin/boot0cfg/boot0cfg.c
@@ -330,10 +330,12 @@ read_mbr(const char *disk, u_int8_t **mbr, int check_version)
err(1, "%s", disk);
if (n != mbr_size)
errx(1, "%s: short read", disk);
+ close(fd);
return (mbr_size);
}
*mbr = malloc(sizeof(buf));
memcpy(*mbr, buf, sizeof(buf));
+ close(fd);
return sizeof(buf);
}