diff options
author | Eryu Guan <guaneryu@gmail.com> | 2015-10-19 19:37:59 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-11-02 09:35:03 +0100 |
commit | 1669d8afa647c63a8a28669b9eadfb64ce98f3d7 (patch) | |
tree | eb82eadaed1559671f44819da67ea9e9369b5f65 /cmds-qgroup.c | |
parent | ae71f1cf53eea91e480dc5f7c9e13338a7e1205c (diff) |
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>
Diffstat (limited to 'cmds-qgroup.c')
-rw-r--r-- | cmds-qgroup.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds-qgroup.c b/cmds-qgroup.c index 0ad99f48..a64b7167 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -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); |