diff options
author | Qu Wenruo <wqu@suse.com> | 2018-02-14 15:50:06 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-02-14 16:31:19 +0100 |
commit | 78c5a90ebf22989b07770de6324cc14a70d72a17 (patch) | |
tree | 8e2c7b6535cd982734078c7f82f14819d2f05f5c /cmds-qgroup.c | |
parent | 54246115ba343d07651eff05e8bf7d159a897670 (diff) |
btrfs-progs: mkfs/rootdir: Fix memory leak in traverse_directory()
The bug is exposed by mkfs test case 009, with D=asan.
We are leaking memory of parent_dir_entry->path() which ,except the
rootdir, is allocated by strdup().
Before fixing it, unifiy the allocation of parent_dir_entry() to heap
allocation.
Then fix it by adding "free(parent_dir_entry->path);" in
traverse_directory() and error handler.
Issue: #92
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-qgroup.c')
0 files changed, 0 insertions, 0 deletions