summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2011-04-24 22:44:23 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2011-04-24 22:44:23 +0000
commit9084a13d76f73b50978738d306c0b4270bb4e635 (patch)
treebb057e0ddfe188b84b8dd7d07d0cbc7839d3b4fb
parented3064c23e348cb8a0555956db96aaa15bc3daa6 (diff)
Don't leak fd's in sr_installboot(). From cppcheck via Amit Kulkarni.
-rw-r--r--sys/arch/amd64/stand/installboot/installboot.c4
-rw-r--r--sys/arch/i386/stand/installboot/installboot.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/arch/amd64/stand/installboot/installboot.c b/sys/arch/amd64/stand/installboot/installboot.c
index 1f89c270823..f4ffd365c76 100644
--- a/sys/arch/amd64/stand/installboot/installboot.c
+++ b/sys/arch/amd64/stand/installboot/installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: installboot.c,v 1.18 2011/03/19 11:55:58 krw Exp $ */
+/* $OpenBSD: installboot.c,v 1.19 2011/04/24 22:44:22 krw Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
@@ -737,6 +737,8 @@ sr_installboot(int devfd)
if (verbose)
fprintf(stderr, "%s is %d blocks x %d bytes\n",
boot, nblocks, bsize);
+
+ close(fd);
}
void
diff --git a/sys/arch/i386/stand/installboot/installboot.c b/sys/arch/i386/stand/installboot/installboot.c
index 85fdb19948b..5ac896d5680 100644
--- a/sys/arch/i386/stand/installboot/installboot.c
+++ b/sys/arch/i386/stand/installboot/installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: installboot.c,v 1.61 2011/03/19 11:55:58 krw Exp $ */
+/* $OpenBSD: installboot.c,v 1.62 2011/04/24 22:44:22 krw Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
@@ -733,6 +733,8 @@ sr_installboot(int devfd)
if (verbose)
fprintf(stderr, "%s is %d blocks x %d bytes\n",
boot, nblocks, bsize);
+
+ close(fd);
}
void