From: Theodore Ts'o Date: Thu, 23 Sep 2010 17:06:31 +0000 (-0400) Subject: libext2fs: Fix memory leak in the Unix I/O layer when changing block size X-Git-Tag: v1.41.13~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faafdb765b4ed2bb33070d998426bec0cf774344;p=thirdparty%2Fe2fsprogs.git libext2fs: Fix memory leak in the Unix I/O layer when changing block size Signed-off-by: "Theodore Ts'o" --- diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index 8c599aa65..78a1d1cba 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;