Blame SOURCES/e2fsprogs-1.42.11-e2fsck-free-ctx-fs-not-fs-at-the-end-of-fsck.patch

98901c
From a82d88ea99d3c5c21bf538b886da0482bf143fd5 Mon Sep 17 00:00:00 2001
98901c
From: "Darrick J. Wong" <darrick.wong@oracle.com>
98901c
Date: Thu, 24 Jul 2014 21:03:54 -0400
98901c
Subject: [PATCH] e2fsck: free ctx->fs, not fs, at the end of fsck
98901c
98901c
When we call ext2fs_close_free at the end of main(), we need to supply
98901c
the address of ctx->fs, because the subsequent e2fsck_free_context
98901c
call will try to access ctx->fs (which is now set to a freed block) to
98901c
see if it should free the directory block list.  This is clearly not
98901c
desirable, so fix the problem.
98901c
98901c
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
98901c
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
98901c
---
98901c
 e2fsck/unix.c | 2 +-
98901c
 1 file changed, 1 insertion(+), 1 deletion(-)
98901c
98901c
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
98901c
index 8d1bdf3e..fc05bdee 100644
98901c
--- a/e2fsck/unix.c
98901c
+++ b/e2fsck/unix.c
98901c
@@ -1774,7 +1774,7 @@ no_journal:
98901c
 	io_channel_flush(ctx->fs->io);
98901c
 	print_resource_track(ctx, NULL, &ctx->global_rtrack, ctx->fs->io);
98901c
 
98901c
-	ext2fs_close_free(&fs);
98901c
+	ext2fs_close_free(&ctx->fs);
98901c
 	free(ctx->journal_name);
98901c
 
98901c
 	e2fsck_free_context(ctx);
98901c
-- 
98901c
2.20.1
98901c