reset: free allocated tree buffers
commitafbb8838b7d4d1887da1e1871f8e9ccd01ae1138
authorJeff King <peff@peff.net>
Tue, 5 Sep 2017 13:04:51 +0000 (5 09:04 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Sep 2017 09:06:26 +0000 (6 18:06 +0900)
treee6a3f3db9bcc1b2508b9484a8d32c8684cc29374
parente9ce897b9fe5a92719eb991ecc0291dd72aab868
reset: free allocated tree buffers

We read the tree objects with fill_tree_descriptor(), but
never actually free the resulting buffers, causing a memory
leak. This isn't a huge deal because we call this code at
most twice per program invocation. But it does potentially
double our heap usage if you have large root trees. Let's
free the trees before returning.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/reset.c