Commit eb3df2c4aa176b3a0493d0656d2d093b4d4c7c9b

Stefan Sperling 2019-07-12T16:42:30

prevent free(3) of uninitialized variable in rebase error path

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/lib/worktree.c b/lib/worktree.c
index a62e681..269d7bc 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -3795,6 +3795,7 @@ got_worktree_rebase_commit(struct got_object_id **new_commit_id,
 	struct got_object_id *commit_id = NULL;
 
 	TAILQ_INIT(&commitable_paths);
+	*new_commit_id = NULL;
 
 	/* Work tree is locked/unlocked during rebase preparation/teardown. */