summaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/main.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-02-08 19:02:24 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-02-08 19:02:24 +0000
commitaec6820f764bce0a08e7fbaae18c355397be975d (patch)
tree169b7f83e88f841300ec9d96a84a148c3b622cef /sbin/fsck_ffs/main.c
parent80ab6fb5c69fe4980292f75b60af96901b22d6f8 (diff)
Plug some mem leaks that occur when checking multiple file systems in a
row. ok beck@ pedro@ millert@
Diffstat (limited to 'sbin/fsck_ffs/main.c')
-rw-r--r--sbin/fsck_ffs/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c
index 327c0c6e20e..989a0de1789 100644
--- a/sbin/fsck_ffs/main.c
+++ b/sbin/fsck_ffs/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.27 2006/04/17 09:34:16 moritz Exp $ */
+/* $OpenBSD: main.c,v 1.28 2007/02/08 19:02:23 otto Exp $ */
/* $NetBSD: main.c,v 1.22 1996/10/11 20:15:48 thorpej Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/23/94";
#else
-static const char rcsid[] = "$OpenBSD: main.c,v 1.27 2006/04/17 09:34:16 moritz Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.28 2007/02/08 19:02:23 otto Exp $";
#endif
#endif /* not lint */
@@ -309,8 +309,14 @@ checkfilesys(char *filesys, char *mntpt, long auxdata, int child)
blockmap = NULL;
free(statemap);
statemap = NULL;
+ free(typemap);
+ typemap = NULL;
free(lncntp);
lncntp = NULL;
+ free(sblock.fs_csp);
+ free(sblk.b_un.b_buf);
+ free(asblk.b_un.b_buf);
+
if (!fsmodified)
return (0);
if (!preen)