[PATCH 5/6] btrfs-progs: free comparer_set in cmd_qgroup_show

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



comparer_set, which was allocated by malloc(), should be free before
function return.

Signed-off-by: Zhao Lei <zhaolei@xxxxxxxxxxxxxx>
---
 cmds-qgroup.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index a64b716..f069d32 100644
--- a/cmds-qgroup.c
+++ b/cmds-qgroup.c
@@ -290,7 +290,7 @@ static int cmd_qgroup_show(int argc, char **argv)
 	int filter_flag = 0;
 	unsigned unit_mode;
 
-	struct btrfs_qgroup_comparer_set *comparer_set;
+	struct btrfs_qgroup_comparer_set *comparer_set = NULL;
 	struct btrfs_qgroup_filter_set *filter_set;
 	filter_set = btrfs_qgroup_alloc_filter_set();
 	comparer_set = btrfs_qgroup_alloc_comparer_set();
@@ -372,6 +372,8 @@ static int cmd_qgroup_show(int argc, char **argv)
 		fprintf(stderr, "ERROR: can't list qgroups: %s\n",
 				strerror(e));
 
+	free(comparer_set);
+
 	return !!ret;
 }
 
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux