mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-27 21:47:56 +00:00
btrfs-progs: don't leak in set_extent_bits
It looks possible to hit the search_again label without using the prealloc. A new prealloc is allocated, leaking the current one. Every use of prealloc sets it to null so let's just allocate a new prealloc when we don't already have one. Signed-off-by: Zach Brown <zab@redhat.com>
This commit is contained in:
parent
de763395fb
commit
09fac3824d
@ -300,9 +300,11 @@ int set_extent_bits(struct extent_io_tree *tree, u64 start,
|
||||
u64 last_start;
|
||||
u64 last_end;
|
||||
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