Commit 1a16e8b0 by Patrick Steinhardt Committed by Edward Thomson

pack-objects: fix memory leak on overflow

parent e114bbac
...@@ -848,8 +848,10 @@ static int try_delta(git_packbuilder *pb, struct unpacked *trg, ...@@ -848,8 +848,10 @@ static int try_delta(git_packbuilder *pb, struct unpacked *trg,
git_packbuilder__cache_unlock(pb); git_packbuilder__cache_unlock(pb);
if (overflow) if (overflow) {
git__free(delta_buf);
return -1; return -1;
}
trg_object->delta_data = git__realloc(delta_buf, delta_size); trg_object->delta_data = git__realloc(delta_buf, delta_size);
GITERR_CHECK_ALLOC(trg_object->delta_data); GITERR_CHECK_ALLOC(trg_object->delta_data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment