Re: leaky cherry-pick
- From
Jeff King <peff@peff.net>
- Date
- Jan 12, 2012, 03:05 UTC
- Message-ID
- <20120112030503.GA26363@sigill.intra.peff.net>
- In-Reply-To
- <7v7h0x6b89.fsf@alter.siamese.dyndns.org>
On Wed, Jan 11, 2012 at 04:00:38PM -0800, Junio C Hamano wrote:
> Yeah, that is definitely a leak.
Here it is with a commit message. "valgrind git cherry-pick" reports no leaks in the attr code after this (but unfortunately still lots of leaks from unpack-trees).
-Peff
-- >8 -- Subject: [PATCH] attr: fix leak in free_attr_elem
This function frees the individual "struct match_attr"s we have allocated, but forgot to free the array holding their pointers, leading to a very minor memory leak.
Signed-off-by: Jeff King <peff@peff.net> --- attr.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/attr.c b/attr.c index 96eda0e..303751f 100644 --- a/attr.c +++ b/attr.c @@ -301,6 +301,7 @@ static void free_attr_elem(struct attr_stack *e) } free(a); } + free(e->attrs); free(e); }
-- 1.7.9.rc0.33.gd3c17