Re: [PATCH] update-cache --refresh cache entry leak
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Apr 17, 2005, 03:35 UTC
- Message-ID
- <Pine.LNX.4.58.0504162033250.7211@ppc970.osdl.org>
- In-Reply-To
- <7v8y3i5o8t.fsf@assigned-by-dhcp.cox.net>
On Sat, 16 Apr 2005, Junio C Hamano wrote:
> > When update-cache --refresh replaces an existing cache entry > with a new one, it forgets to free the original.
I've seen this patch now three times, and it's been wrong every single time. Maybe we should add a comment?
That active-cache entry you free()'d was not necessarily allocated with malloc(). Most cache-entries are just mmap'ed directly from the index file.
Leaking is ok. We cannot leak too much.
Linus