]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: fix possible memory leak in write_journal_inode()
authorNamhyung Kim <namhyung@gmail.com>
Mon, 29 Nov 2010 08:55:16 +0000 (17:55 +0900)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 22 Dec 2010 15:43:01 +0000 (10:43 -0500)
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>
lib/ext2fs/mkjournal.c

index 9466e783de3356ae0580c67ffd92fab1aa10640f..242c53761f29f5f7124837201efb3ce57186c7d7 100644 (file)
@@ -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;
 }