don't close a tree in the wrong place; fixes a bus error crash
diff --git a/lib/worktree.c b/lib/worktree.c
index 10ad383..9f94387 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -2654,8 +2654,6 @@ write_tree(struct got_object_id **new_tree_id,
done:
got_object_tree_entries_close(&new_tree_entries);
got_pathlist_free(&paths);
- if (base_tree)
- got_object_tree_close(base_tree);
return err;
}