blame: handle hunk creation failures

`hunk_from_entry` can return `NULL` on error; handle that and return an
error.
This commit is contained in:
Edward Thomson
2026-06-06 13:29:16 +01:00
parent 94c5178b5d
commit 47062f5d51

View File

@@ -461,6 +461,12 @@ static int blame_internal(git_blame *blame)
for (ent = blame->ent; ent; ent = ent->next) {
git_blame_hunk *h = hunk_from_entry(ent, blame);
if (!h) {
error = -1;
goto on_error;
}
git_vector_insert(&blame->hunks, h);
}