mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-21 22:16:24 +00:00
blame: handle hunk creation failures
`hunk_from_entry` can return `NULL` on error; handle that and return an error.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user