Blame SOURCES/e2fsprogs-1.45.5-libext2fs-properly-free-the-bitmaps-in-read_bitmap-s.patch

a9c310
From 764286ba7af40105ec9f27dba164fa53936c282f Mon Sep 17 00:00:00 2001
a9c310
From: Theodore Ts'o <tytso@mit.edu>
a9c310
Date: Fri, 8 Nov 2019 09:49:51 -0500
a9c310
Subject: [PATCH 04/10] libext2fs: properly free the bitmaps in read_bitmap()'s
a9c310
 error/cleanup path
a9c310
a9c310
Use ext2fs_free_{block,inode}_bitmaps() instead of ext2fs_free_mem()
a9c310
to avoid some memory leaks if there is an error while calling
a9c310
read_bitmaps().
a9c310
a9c310
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
a9c310
---
a9c310
 lib/ext2fs/rw_bitmaps.c | 4 ++--
a9c310
 1 file changed, 2 insertions(+), 2 deletions(-)
a9c310
a9c310
diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c
a9c310
index f1c4188b..e092cab0 100644
a9c310
--- a/lib/ext2fs/rw_bitmaps.c
a9c310
+++ b/lib/ext2fs/rw_bitmaps.c
a9c310
@@ -396,11 +396,11 @@ success_cleanup:
a9c310
 
a9c310
 cleanup:
a9c310
 	if (do_block) {
a9c310
-		ext2fs_free_mem(&fs->block_map);
a9c310
+		ext2fs_free_block_bitmap(fs->block_map);
a9c310
 		fs->block_map = 0;
a9c310
 	}
a9c310
 	if (do_inode) {
a9c310
-		ext2fs_free_mem(&fs->inode_map);
a9c310
+		ext2fs_free_inode_bitmap(fs->inode_map);
a9c310
 		fs->inode_map = 0;
a9c310
 	}
a9c310
 	if (inode_bitmap)
a9c310
-- 
a9c310
2.21.1
a9c310