From 0628ae3948d5a7d0945411add9091d07ff2b3f41 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 29 Jul 2001 12:26:46 -0400 Subject: [PATCH] unix.c (main): Move the final print_resource_track call after the filesystem and context handle are closed --- e2fsck/ChangeLog | 2 ++ e2fsck/unix.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 93ac264..b3089f2 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -6,6 +6,8 @@ (PRS): Only update the path to include /sbin at the beginning if the -c option is given, again to make it easier to find memory leaks. + (main): Move the final print_resource_track call after the + filesystem and the context are freed. * journal.c (e2fsck_journal_init_dev): Avoid memory leak if we need to search for the journal device. diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 1dae3d4..dc5c39e 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -990,14 +990,14 @@ restart: e2fsck_write_bitmaps(ctx); + ext2fs_close(fs); + ctx->fs = NULL; + e2fsck_free_context(ctx); + #ifdef RESOURCE_TRACK if (ctx->options & E2F_OPT_TIME) print_resource_track(NULL, &ctx->global_rtrack); #endif - ext2fs_close(fs); - ctx->fs = NULL; - e2fsck_free_context(ctx); - return exit_value; } -- 1.8.3.1