Commit edfa7d7fafb6ce603f9463e5184d2586be36234e

Stefan Sperling 2018-09-11T11:31:34

plug a tree object leak in worktree.c

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/worktree.c b/lib/worktree.c
index 3274af2..d93818f 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -654,6 +654,8 @@ got_worktree_checkout_files(struct got_worktree *worktree,
 	new_fileindex_path = NULL;
 
 done:
+	if (tree)
+		got_object_tree_close(tree);
 	if (commit)
 		got_object_commit_close(commit);
 	if (obj)