Skip to content

Commit 468600c

Browse files
dinghaoliukdave
authored andcommitted
btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod
There is one error handling path that does not free ref, which may cause a minor memory leak. CC: [email protected] # 4.19+ Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: Dinghao Liu <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent cf89af1 commit 468600c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/btrfs/ref-verify.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
860860
"dropping a ref for a root that doesn't have a ref on the block");
861861
dump_block_entry(fs_info, be);
862862
dump_ref_action(fs_info, ra);
863+
kfree(ref);
863864
kfree(ra);
864865
goto out_unlock;
865866
}

0 commit comments

Comments
 (0)