mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-06 12:52:01 +00:00
btrfs-progs: check: Fix memory leak in check_chunks_and_extents
fsck/003-shift-offsets makes valgrinds complaining about memory leaks. ==5910== ==5910== HEAP SUMMARY: ==5910== in use at exit: 1,112 bytes in 11 blocks ==5910== total heap usage: 161 allocs, 150 frees, 164,800 bytes allocated ==5910== ==5910== 216 (72 direct, 144 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 5 ==5910== at 0x4C2AF1F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==5910== by 0x4815A3: add_root_item_to_list (cmds-check.c:9683) ==5910== by 0x481CE2: check_chunks_and_extents (cmds-check.c:9886) ==5910== by 0x48888B: cmd_check (cmds-check.c:12977) ==5910== by 0x40A8C5: main (btrfs.c:246) ==5910== The check_chunks_and_extents() memory leaks are caused by not freeing added root items of normal_trees and dropping_trees. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
b75c0720a4
commit
f80b1f1db6
@ -9972,6 +9972,8 @@ out:
|
||||
free_extent_cache_tree(&pending);
|
||||
free_extent_cache_tree(&reada);
|
||||
free_extent_cache_tree(&nodes);
|
||||
free_root_item_list(&normal_trees);
|
||||
free_root_item_list(&dropping_trees);
|
||||
return ret;
|
||||
loop:
|
||||
free_corrupt_blocks_tree(root->fs_info->corrupt_blocks);
|
||||
|
Loading…
Reference in New Issue
Block a user