Whamcloud - gitweb
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 8c599aa..78a1d1c 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;