From: Namhyung Kim Date: Mon, 29 Nov 2010 08:55:16 +0000 (+0900) Subject: libext2fs: fix possible memory leak in write_journal_inode() X-Git-Tag: v1.42-WIP-0702~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91dc3f0db0185503083f54c7b464900c851df0aa;p=thirdparty%2Fe2fsprogs.git 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 Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c index 9466e783d..242c53761 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; }