Commit dd78d7d15b9566e369b9bc48c72a48d77e0c34eb

Patrick Steinhardt 2016-03-10T16:33:49

blame_git: handle error returned by `git_commit_parent`

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/blame_git.c b/src/blame_git.c
index b8b5682..700207e 100644
--- a/src/blame_git.c
+++ b/src/blame_git.c
@@ -525,7 +525,8 @@ static int pass_blame(git_blame *blame, git_blame__origin *origin, uint32_t opt)
 		if (sg_origin[i])
 			continue;
 
-		git_commit_parent(&p, origin->commit, i);
+		if ((error = git_commit_parent(&p, origin->commit, i)) < 0)
+			goto finish;
 		porigin = find_origin(blame, p, origin);
 
 		if (!porigin)