diff --git a/disk-io.c b/disk-io.c index a9fd3749..6ef35bbf 100644 --- a/disk-io.c +++ b/disk-io.c @@ -660,11 +660,12 @@ static int find_and_setup_log_root(struct btrfs_root *tree_root, fs_info->log_root_tree = log_root; if (!extent_buffer_uptodate(log_root->node)) { + free_extent_buffer(log_root->node); free(log_root); + fs_info->log_root_tree = NULL; return -EIO; } - free(log_root); return 0; }