pack-objects: fix memory leak on overflow

This commit is contained in:
Patrick Steinhardt 2016-03-01 17:55:40 +01:00 committed by Edward Thomson
parent e114bbac89
commit 1a16e8b057

View File

@ -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);