mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-10 05:34:34 +00:00
pack-objects: fix memory leak on overflow
This commit is contained in:
parent
e114bbac89
commit
1a16e8b057
@ -848,8 +848,10 @@ static int try_delta(git_packbuilder *pb, struct unpacked *trg,
|
||||
|
||||
git_packbuilder__cache_unlock(pb);
|
||||
|
||||
if (overflow)
|
||||
if (overflow) {
|
||||
git__free(delta_buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
trg_object->delta_data = git__realloc(delta_buf, delta_size);
|
||||
GITERR_CHECK_ALLOC(trg_object->delta_data);
|
||||
|
Loading…
Reference in New Issue
Block a user