diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-07-05 09:26:24 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-07-05 18:47:57 +0200 |
commit | e02d48eaaed77f6c36916a7aa65c451e1f9d9aab (patch) | |
tree | 59aec3f4273813834a2259005c104c1ec92ff919 /samples | |
parent | btrfs: move the subvolume reservation stuff out of extent-tree.c (diff) | |
download | linux-e02d48eaaed77f6c36916a7aa65c451e1f9d9aab.tar.xz linux-e02d48eaaed77f6c36916a7aa65c451e1f9d9aab.zip |
btrfs: fix memory leak of path on error return path
Currently if the allocation of roots or tmp_ulist fails the error handling
does not free up the allocation of path causing a memory leak. Fix this and
other similar leaks by moving the call of btrfs_free_path from label out
to label out_free_ulist.
Kudos to David Sterba for spotting the issue in my original fix and suggesting
the correct way to fix the leak and Anand Jain for spotting a double free
issue.
Addresses-Coverity: ("Resource leak")
Fixes: 5911c8fe05c5 ("btrfs: fiemap: preallocate ulists for btrfs_check_shared")
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'samples')
0 files changed, 0 insertions, 0 deletions