From: Theodore Ts'o Date: Tue, 19 Feb 2008 13:33:50 +0000 (-0500) Subject: Fix memory leak in ext2fs_alloc_block() X-Git-Tag: v1.40.7~30 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7a3e1b7bff8c6734921ca80401a6377e070a7cb1;p=tools%2Fe2fsprogs.git Fix memory leak in ext2fs_alloc_block() If a block buffer was not supplied and ext2fs_alloc_block() returned with no errors, it would leak a temporary block buffer. Signed-off-by: "Theodore Ts'o" --- diff --git a/lib/ext2fs/alloc.c b/lib/ext2fs/alloc.c index 7385123..65f3ea1 100644 --- a/lib/ext2fs/alloc.c +++ b/lib/ext2fs/alloc.c @@ -134,7 +134,6 @@ errcode_t ext2fs_alloc_block(ext2_filsys fs, blk_t goal, ext2fs_block_alloc_stats(fs, block, +1); *ret = block; - return 0; fail: if (buf)