Skip to content

Commit 379cde7

Browse files
Stefan BehrensJosef Bacik
authored andcommitted
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>
1 parent c16c2e2 commit 379cde7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/btrfs/relocation.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ int replace_path(struct btrfs_trans_handle *trans,
17731773
if (!eb || !extent_buffer_uptodate(eb)) {
17741774
ret = (!eb) ? -ENOMEM : -EIO;
17751775
free_extent_buffer(eb);
1776-
return ret;
1776+
break;
17771777
}
17781778
btrfs_tree_lock(eb);
17791779
if (cow) {

0 commit comments

Comments
 (0)