summaryrefslogtreecommitdiff
path: root/lib/ext2fs/mkjournal.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2010-11-29 17:55:16 +0900
committerTheodore Ts'o <tytso@mit.edu>2010-12-22 10:43:01 -0500
commit91dc3f0db0185503083f54c7b464900c851df0aa (patch)
treec6376871ae8b16031e30c8210b8aa7a22fd03515 /lib/ext2fs/mkjournal.c
parent8a1cf3c243cf8447d814c4e3432fcf6282aa40e9 (diff)
downloade2fsprogs-91dc3f0db0185503083f54c7b464900c851df0aa.tar.gz
libext2fs: fix possible memory leak in write_journal_inode()
ext2fs_zero_block2() allocates static buffer if needed so it should be freed at last (call it again with 0 args). Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'lib/ext2fs/mkjournal.c')
-rw-r--r--lib/ext2fs/mkjournal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c
index 9466e783..242c5376 100644
--- a/lib/ext2fs/mkjournal.c
+++ b/lib/ext2fs/mkjournal.c
@@ -376,6 +376,7 @@ static errcode_t write_journal_inode(ext2_filsys fs, ext2_ino_t journal_ino,
ext2fs_mark_super_dirty(fs);
errout:
+ ext2fs_zero_blocks2(0, 0, 0, 0, 0);
ext2fs_free_mem(&buf);
return retval;
}