btrfs: tests: fix double btrfs_path free in remove_extent_ref()

We converted this code to use auto free cleanup.h magic but one
remaining free was accidentally left behind which leads to a double free
bug.

Fixes: a320476ca8 ("btrfs: tests: do trivial BTRFS_PATH_AUTO_FREE conversions")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
pull/1354/merge
Dan Carpenter 2025-11-27 10:14:24 +03:00 committed by David Sterba
parent 9e0e6577b3
commit 564d59410c
1 changed files with 0 additions and 1 deletions

View File

@ -187,7 +187,6 @@ static int remove_extent_ref(struct btrfs_root *root, u64 bytenr,
ret = btrfs_search_slot(&trans, root, &key, path, -1, 1);
if (ret) {
test_err("couldn't find backref %d", ret);
btrfs_free_path(path);
return ret;
}
btrfs_del_item(&trans, root, path);