projects
/
platform
/
upstream
/
btrfs-progs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8e884f
)
btrfs-progs: let callers of btrfs_show_qgroups free the buffers
author
David Sterba
<dsterba@suse.com>
Thu, 15 Feb 2018 17:13:35 +0000
(18:13 +0100)
committer
David Sterba
<dsterba@suse.com>
Fri, 16 Feb 2018 15:59:42 +0000
(16:59 +0100)
btrfs_show_qgroups frees the filter and comparer in case it succeeds.
This makes the caller slightly more complicated so move the freeing up
one level.
Issue: #20
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-qgroup.c
patch
|
blob
|
history
qgroup.c
patch
|
blob
|
history
diff --git
a/cmds-qgroup.c
b/cmds-qgroup.c
index
4f99e41
..
4868643
100644
(file)
--- a/
cmds-qgroup.c
+++ b/
cmds-qgroup.c
@@
-396,6
+396,8
@@
static int cmd_qgroup_show(int argc, char **argv)
}
ret = btrfs_show_qgroups(fd, filter_set, comparer_set);
close_file_or_dir(fd, dirstream);
+ free(filter_set);
+ free(comparer_set);
out:
return !!ret;
diff --git
a/qgroup.c
b/qgroup.c
index
b5b893f
..
11659e8
100644
(file)
--- a/
qgroup.c
+++ b/
qgroup.c
@@
-1192,8
+1192,6
@@
int btrfs_show_qgroups(int fd,
print_all_qgroups(&sort_tree);
__free_all_qgroups(&qgroup_lookup);
- free(filter_set);
- free(comp_set);
return ret;
}