summaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/main.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2011-04-16 16:37:22 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2011-04-16 16:37:22 +0000
commitc9c962ef3d8d8b60db309c45a20d99b6e27cad53 (patch)
treee962ab2baaf76984978ccd2fdfa764779d66a200 /sbin/fsck_ffs/main.c
parentdec35c38d9c9a61a44ab91d3ed9421880058b08d (diff)
Blend in some code from netbsd and freebsd that reduces memory consumption
and speeds things up in a lot of cases. Prompted by Amit Kulkarni; ok krw@ on a slighly diffrenent incarnation
Diffstat (limited to 'sbin/fsck_ffs/main.c')
-rw-r--r--sbin/fsck_ffs/main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c
index b4817ce9626..ff585478f3a 100644
--- a/sbin/fsck_ffs/main.c
+++ b/sbin/fsck_ffs/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.36 2010/08/12 15:26:34 jsing Exp $ */
+/* $OpenBSD: main.c,v 1.37 2011/04/16 16:37:21 otto Exp $ */
/* $NetBSD: main.c,v 1.22 1996/10/11 20:15:48 thorpej Exp $ */
/*
@@ -282,12 +282,14 @@ checkfilesys(char *filesys, char *mntpt, long auxdata, int child)
if (rerun)
resolved = 0;
ckfini(resolved); /* Don't mark fs clean if fsck needs to be re-run */
+
+ for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
+ free(inostathead[cylno].il_stat);
+ free(inostathead);
+ inostathead = NULL;
+
free(blockmap);
blockmap = NULL;
- free(stmap);
- stmap = NULL;
- free(lncntp);
- lncntp = NULL;
free(sblock.fs_csp);
free(sblk.b_un.b_buf);
free(asblk.b_un.b_buf);