Skip to contentSkip to conversation

Btrfs: fix double free in the iterate_extent_inodes()

PATCH Superseded Wang Shilong 1 participant 1 message Mar 29, 2013 Btrfs file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: fix double free in the iterate_extent_inodes()

From: Wang Shilong <[email protected]>

If btrfs_find_all_roots() fails, 'roots' has been freed or 'roots' fails to allocate. we don't need to free it outside btrfs_find_all_roots() again.Fix it.

---
 fs/btrfs/backref.c | 1 -
 1 file changed, 1 deletion(-)
fs/btrfs/backref.c +0 -1
index 5ff46ee..3ca413bb 100644
@@ -1514,7 +1514,6 @@ int iterate_extent_inodes(struct btrfs_fs_info *fs_info,
 	}
 
 	free_leaf_list(refs);
-	ulist_free(roots);
 out:
 	if (!search_commit_root) {
 		btrfs_put_tree_mod_seq(fs_info, &tree_mod_seq_elem);
Signature · 1 line
1.7.11.7