pack-bitmap[-write]: use `object_array_clear()`, don't leak
commit4d01a7fa65c50e817a935396432e199b7a565f53
authorMartin Ågren <martin.agren@gmail.com>
Fri, 22 Sep 2017 23:34:54 +0000 (23 01:34 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 24 Sep 2017 01:06:08 +0000 (24 10:06 +0900)
tree32beebc4564f7b19405f3b8f2fefb70b59606836
parent719920393737b3934a168f35ab45e09104edeed8
pack-bitmap[-write]: use `object_array_clear()`, don't leak

Instead of setting the fields of rev->pending to 0/NULL, thereby leaking
memory, call `object_array_clear(&rev->pending)`.

In pack-bitmap.c, we make copies of those fields as `pending_nr` and
`pending_e`. We never update the aliases and the original fields never
change, so the aliases are not really needed and just make it harder
than necessary to understand the code. While we're here, remove the
aliases to make the code easier to follow.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap-write.c
pack-bitmap.c