btrfs-progs: clear_extent_bits: Fix memory leak.

The 'prealloc' extent_state structure is leaked for the case when the 'desired
range' encapsulates/covers the 'extent range'.

Signed-off-by: chandan <chandan@linux.vnet.ibm.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
chandan 2013-09-20 23:52:11 +05:30 committed by Chris Mason
parent 1b10eaa8e1
commit 120e27d76f

View File

@ -210,9 +210,11 @@ int clear_extent_bits(struct extent_io_tree *tree, u64 start,
int set = 0;
again:
prealloc = alloc_extent_state();
if (!prealloc)
return -ENOMEM;
if (!prealloc) {
prealloc = alloc_extent_state();
if (!prealloc)
return -ENOMEM;
}
/*
* this search will find the extents that end after