Commit f66c734c57ba39774198d381b7f9a27cfdd30abe

Stefan Sperling 2019-09-22T15:24:34

missing error check in write_tree(); found by jj@ with scan-build

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/worktree.c b/lib/worktree.c
index 9fc13a8..aa70f13 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -3879,6 +3879,8 @@ write_tree(struct got_object_id **new_tree_id,
 
 			err = match_deleted_or_modified_ct(&ct, te,
 			    path_base_tree, commitable_paths);
+			if (err)
+				goto done;
 			if (ct) {
 				/* NB: Deleted entries get dropped here. */
 				if (ct->status == GOT_STATUS_MODIFY ||