btrfs-progs/mkfs
Qu Wenruo 78c5a90ebf 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>
2018-02-14 16:31:19 +01:00
..
common.c btrfs-progs: treewide: Replace strerror(errno) with %m. 2018-01-31 15:14:03 +01:00
common.h btrfs-progs: mkfs: Enhance minimal device size calculation to fix mkfs failure on small file 2018-01-03 17:10:11 +01:00
main.c btrfs-progs: mkfs: fix build on musl 2018-02-03 01:15:42 +01:00
rootdir.c btrfs-progs: mkfs/rootdir: Fix memory leak in traverse_directory() 2018-02-14 16:31:19 +01:00
rootdir.h btrfs-progs: mkfs/rootdir: Fix memory leak in traverse_directory() 2018-02-14 16:31:19 +01:00