Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6dac306
)
libext2fs: properly free the bitmaps in read_bitmap()'s error/cleanup path
author
Theodore Ts'o
<tytso@mit.edu>
Fri, 8 Nov 2019 14:49:51 +0000
(09:49 -0500)
committer
Theodore Ts'o
<tytso@mit.edu>
Fri, 8 Nov 2019 14:49:51 +0000
(09:49 -0500)
Use ext2fs_free_{block,inode}_bitmaps() instead of ext2fs_free_mem()
to avoid some memory leaks if there is an error while calling
read_bitmaps().
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/rw_bitmaps.c
patch
|
blob
|
history
diff --git
a/lib/ext2fs/rw_bitmaps.c
b/lib/ext2fs/rw_bitmaps.c
index
f1c4188
..
e092cab
100644
(file)
--- a/
lib/ext2fs/rw_bitmaps.c
+++ b/
lib/ext2fs/rw_bitmaps.c
@@
-396,11
+396,11
@@
success_cleanup:
cleanup:
if (do_block) {
- ext2fs_free_
mem(&
fs->block_map);
+ ext2fs_free_
block_bitmap(
fs->block_map);
fs->block_map = 0;
}
if (do_inode) {
- ext2fs_free_
mem(&
fs->inode_map);
+ ext2fs_free_
inode_bitmap(
fs->inode_map);
fs->inode_map = 0;
}
if (inode_bitmap)