From: Gui Hecheng Date: Thu, 5 Sep 2013 02:38:56 +0000 (+0800) Subject: btrfs-progs: missing tree-freeing statements added X-Git-Tag: upstream/4.16.1~3138 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0785476db045ba599ae4dd5517a1b11bc36ac811;p=platform%2Fupstream%2Fbtrfs-progs.git 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 Signed-off-by: David Sterba Signed-off-by: Chris Mason --- diff --git a/cmds-check.c b/cmds-check.c index df18c43..b23353e 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);