Message ID | 1506418111-26620-1-git-send-email-gujx@cn.fujitsu.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Sep 26, 2017 at 05:28:31PM +0800, Gu Jinxiang wrote: > When quota disabled, btrfs qgroup show exit with a error message, > but the allocated memory is not freed. > > By the way, this bug marked as issue#20 in github. > > Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/cmds-qgroup.c b/cmds-qgroup.c index 38382ea9..5fbfaa17 100644 --- a/cmds-qgroup.c +++ b/cmds-qgroup.c @@ -369,9 +369,8 @@ static int cmd_qgroup_show(int argc, char **argv) path = argv[optind]; fd = btrfs_open_dir(path, &dirstream, 1); if (fd < 0) { - free(filter_set); - free(comparer_set); - return 1; + ret = 1; + goto out; } if (sync) { @@ -406,6 +405,10 @@ static int cmd_qgroup_show(int argc, char **argv) close_file_or_dir(fd, dirstream); out: + if (filter_set) + free(filter_set); + if (comparer_set) + free(comparer_set); return !!ret; }
When quota disabled, btrfs qgroup show exit with a error message, but the allocated memory is not freed. By the way, this bug marked as issue#20 in github. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> --- cmds-qgroup.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)