diff options
author | Gui Hecheng <guihc.fnst@cn.fujitsu.com> | 2013-09-05 10:38:56 +0800 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-10-16 08:20:42 -0400 |
commit | 0785476db045ba599ae4dd5517a1b11bc36ac811 (patch) | |
tree | 03ce83444dc248029bc0f6c456472b067b377cdc /cmds-check.c | |
parent | 28abed7b0fc214410f43f428e467c5f26be85755 (diff) |
btrfs-progs: missing tree-freeing statements added
The seen cache_tree in run_next_block freed.
Originally, this "missing" causes memory leaks, reported by valgrind.
Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r-- | cmds-check.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmds-check.c b/cmds-check.c index df18c436..b23353e6 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -3521,6 +3521,11 @@ static int run_next_block(struct btrfs_root *root, remove_cache_extent(nodes, cache); free(cache); } + cache = lookup_cache_extent(seen, bytenr, size); + if (cache) { + remove_cache_extent(seen, cache); + free(cache); + } /* fixme, get the real parent transid */ buf = read_tree_block(root, bytenr, size, 0); |