Re: [PATCH 1/7] init: plug tiny one-time memory leak
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 3, 2010, 23:46 UTC
- Message-ID
- <7vpqvqdelx.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20101002083122.GB29638@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
> The buffer used to construct paths like ".git/objects/info" and > ".git/objects/pack" is allocated on the heap and never freed.
While at it it might be a good idea to rename its outdated name to something saner, e.g. object_dir, perhaps?
In v0.99 days, it make some sense to call that sha1_dir because we prepopulated 256 subdirectories 00-ff in it, and as an afterthought we reused the buffer to create an extra subdirectory "/pack" there. But we do not create the fan-out in advance since 9106c09 (Create object subdirectories on demand (phase II), 2005-10-09); sha1_dir is not a very good name for the buffer to hold the path to ".git/objects" anymore.