diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-01-06 17:57:22 +0100 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-01-18 02:40:20 +0100 |
commit | 2423fdfb96e3f9ff3baeb6c4c78d74145547891d (patch) | |
tree | a47f7712849dd9ab5c4a1c3371511e072abcdb29 /fs/btrfs/relocation.c | |
parent | Btrfs: align offsets for btrfs_ordered_update_i_size (diff) | |
download | linux-2423fdfb96e3f9ff3baeb6c4c78d74145547891d.tar.xz linux-2423fdfb96e3f9ff3baeb6c4c78d74145547891d.zip |
Btrfs, fix memory leaks in error paths
Stanse found 2 memory leaks in relocate_block_group and
__btrfs_map_block. cluster and multi are not freed/assigned on all
paths. Fix that.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index a9728680eca8..ed3e4a2ec2c8 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -3281,8 +3281,10 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) return -ENOMEM; path = btrfs_alloc_path(); - if (!path) + if (!path) { + kfree(cluster); return -ENOMEM; + } rc->extents_found = 0; rc->extents_skipped = 0; |