mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-11 03:31:17 +00:00
btrfs-progs: fix memory leak in cmd_qgroup_show()
filter_set and comparer_set should be freed on return. Signed-off-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ae71f1cf53
commit
1669d8afa6
@ -348,8 +348,11 @@ static int cmd_qgroup_show(int argc, char **argv)
|
||||
|
||||
path = argv[optind];
|
||||
fd = btrfs_open_dir(path, &dirstream, 1);
|
||||
if (fd < 0)
|
||||
if (fd < 0) {
|
||||
btrfs_qgroup_free_filter_set(filter_set);
|
||||
btrfs_qgroup_free_comparer_set(comparer_set);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (filter_flag) {
|
||||
qgroupid = btrfs_get_path_rootid(fd);
|
||||
|
Loading…
Reference in New Issue
Block a user