mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 21:44:58 +00:00
pack-objects: check realloc in try_delta with GITERR_CHECK_ALLOC
This commit is contained in:
parent
2129d6df93
commit
d1c9a48df6
@ -850,9 +850,11 @@ static int try_delta(git_packbuilder *pb, struct unpacked *trg,
|
||||
|
||||
git_packbuilder__cache_unlock(pb);
|
||||
|
||||
if (overflow ||
|
||||
!(trg_object->delta_data = git__realloc(delta_buf, delta_size)))
|
||||
if (overflow)
|
||||
return -1;
|
||||
|
||||
trg_object->delta_data = git__realloc(delta_buf, delta_size);
|
||||
GITERR_CHECK_ALLOC(trg_object->delta_data);
|
||||
} else {
|
||||
/* create delta when writing the pack */
|
||||
git_packbuilder__cache_unlock(pb);
|
||||
|
Loading…
Reference in New Issue
Block a user