]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: Fix memory leak in the Unix I/O layer when changing block size
authorTheodore Ts'o <tytso@mit.edu>
Thu, 23 Sep 2010 17:06:31 +0000 (13:06 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 23 Sep 2010 20:38:26 +0000 (16:38 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/unix_io.c

index 8c599aa6515852d0d019b4820784caa586f2cc2d..78a1d1cbab8cf2088d3ee1b8679d0f3851b73cc3 100644 (file)
@@ -302,6 +302,8 @@ static errcode_t alloc_cache(io_channel channel,
                cache->access_time = 0;
                cache->dirty = 0;
                cache->in_use = 0;
+               if (cache->buf)
+                       ext2fs_free_mem(&cache->buf);
                if ((retval = ext2fs_get_mem(channel->block_size,
                                             &cache->buf)))
                        return retval;