From a2299ad8e5c2ff1bd7ecd849489e1d073be22e10 Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Wed, 1 Dec 2010 08:07:32 +0000 Subject: [PATCH] Closing file descriptors when it's done --- sbin/bsdlabel/bsdlabel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 974150d81fc..4e8ac1adf43 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -370,10 +370,12 @@ readboot(void) p[60] = (st.st_size + secsize - 1) / secsize; p[61] = 1; p[62] = 0; + close(fd); return; } else if ((!alphacksum) && st.st_size <= BBSIZE) { if (read(fd, bootarea, st.st_size) != st.st_size) err(1, "read error %s", xxboot); + close(fd); return; } errx(1, "boot code %s is wrong size", xxboot);