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

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