Whamcloud - gitweb
Fix use-after-free bug of e2fsck context structure.
authorTheodore Ts'o <tytso@mit.edu>
Mon, 25 Jul 2005 16:36:43 +0000 (11:36 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 25 Jul 2005 16:36:43 +0000 (11:36 -0500)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/ChangeLog
e2fsck/unix.c

index 53cbbb0..deec7ea 100644 (file)
@@ -1,5 +1,8 @@
 2005-07-25  Theodore Ts'o  <tytso@mit.edu>
 
+       * unix.c (main): Fix a use-after-free bug of the e2fsck context
+               structure at the very end of the e2fsck run.
+
        * pass1.c (pass1_write_inode): Fix false positive from valgrind;
                don't do a needless structure copy via an assignment when
                it is a no-op.
index 1d74929..6cbcb10 100644 (file)
@@ -1168,12 +1168,11 @@ restart:
        ctx->fs = NULL;
        free(ctx->filesystem_name);
        free(ctx->journal_name);
-       e2fsck_free_context(ctx);
-       
+
 #ifdef RESOURCE_TRACK
        if (ctx->options & E2F_OPT_TIME)
                print_resource_track(NULL, &ctx->global_rtrack);
 #endif
-
+       e2fsck_free_context(ctx);
        return exit_value;
 }