mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-23 22:53:35 +00:00
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:
parent
1b10eaa8e1
commit
120e27d76f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user