]> git.ipfire.org Git - thirdparty/git.git/commit - object.h
object_array: add a "clear" function
authorJeff King <peff@peff.net>
Wed, 15 Oct 2014 22:34:34 +0000 (18:34 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Oct 2014 17:10:37 +0000 (10:10 -0700)
commit46be823124bb6a6ff0e06dc19c327b599ed97c72
tree3cd5b02dcf8316c8416ae850771d2fdb159e7d42
parent68f492359e29bbdf633201406d0646deee2b298c
object_array: add a "clear" function

There's currently no easy way to free the memory associated
with an object_array (and in most cases, we simply leak the
memory in a rev_info's pending array). Let's provide a
helper to make this easier to handle.

We can make use of it in list-objects.c, which does the same
thing by hand (but fails to free the "name" field of each
entry, potentially leaking memory).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
list-objects.c
object.c
object.h