diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2013-05-08 04:56:09 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-05-17 21:40:19 -0400 |
commit | 379cde741b220091d2124fb500b178b90ad7f460 (patch) | |
tree | 0f6426bbd7572c279ca365718c1e6da092a42445 /fs/btrfs | |
parent | c16c2e2e51c2f0951fffa73c343b8fcb641108ba (diff) |
Btrfs: fix possible memory leak in replace_path()
In replace_path(), if read_tree_block() fails, we cannot return
directly, we should free some allocated memory otherwise memory
leak happens.
Similar to Wang's "Btrfs: fix possible memory leak in the
find_parent_nodes()" patch, the current commit fixes an issue that
is related to the "Btrfs: fix all callers of read_tree_block"
commit.
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/relocation.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 704a1b8d2a2b..5c5b8bb44ee5 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -1773,7 +1773,7 @@ again: | |||
1773 | if (!eb || !extent_buffer_uptodate(eb)) { | 1773 | if (!eb || !extent_buffer_uptodate(eb)) { |
1774 | ret = (!eb) ? -ENOMEM : -EIO; | 1774 | ret = (!eb) ? -ENOMEM : -EIO; |
1775 | free_extent_buffer(eb); | 1775 | free_extent_buffer(eb); |
1776 | return ret; | 1776 | break; |
1777 | } | 1777 | } |
1778 | btrfs_tree_lock(eb); | 1778 | btrfs_tree_lock(eb); |
1779 | if (cow) { | 1779 | if (cow) { |