Commit Diff


commit - 6bef87be901a62ffff4a5e52932fdab9c0d8cb27
commit + edfa7d7fafb6ce603f9463e5184d2586be36234e
blob - 3274af20084b72b6a316f580c06eea4bb22a4ac7
blob + d93818fe53197d1dd8f8e7737b6837d4411b46c6
--- lib/worktree.c
+++ lib/worktree.c
@@ -654,6 +654,8 @@ got_worktree_checkout_files(struct got_worktree *workt
 	new_fileindex_path = NULL;
 
 done:
+	if (tree)
+		got_object_tree_close(tree);
 	if (commit)
 		got_object_commit_close(commit);
 	if (obj)