From faafdb765b4ed2bb33070d998426bec0cf774344 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 23 Sep 2010 13:06:31 -0400 Subject: [PATCH] libext2fs: Fix memory leak in the Unix I/O layer when changing block size Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/unix_io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index 8c599aa..78a1d1c 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -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; -- 1.8.3.1