From: Ingo Molnar Date: Thu, 14 Apr 2005 15:14:56 GMT Subject: Re: [patch] git: fix memory leak #2 in read-cache.c Message-ID: <20050414151456.GA11385@elte.hu> In-Reply-To: * Linus Torvalds wrote: > In other words, if the common case is that we update a couple of > entries in the active cache, we actually saved 1.6MB (+ malloc > overhead for the 17 _thousand_ allocations) by my approach. > > And the leak? There's none. We never actually update an existing entry > that was allocated with malloc(), unless the user does something > stupid. In other words, the only case where there is a "leak" is when > the user does something like > > update-cache file file file file file file .. > > with the same file listed several times. fair enough - as long as this is only used in a scripted environment, and not via some library and not within a repository server, web backend, etc. Ingo