Re: [RFC] get_pathspec(): free() old buffer if rewriting
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 6, 2006, 22:44 UTC
- Message-ID
- <Pine.LNX.4.63.0605070041540.26058@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <Pine.LNX.4.64.0605061532190.16343@g5.osdl.org>
Hi,
On Sat, 6 May 2006, Linus Torvalds wrote:
Show 10 quoted lines
> On Sun, 7 May 2006, Johannes Schindelin wrote: > > > > This might be the wrong way to do it, but as it is without this patch, > > get_pathspec() is leaking memory. > > I'm not at all convinced we want to do somethng like this. > > get_pathspec() is a one-time event. It doesn't "leak" memory. To me, > "leaking" is when you continually lose a bit of memory, and you eventually > run out. I don't see that happening here.
I see your point. That was exactly why I put "RFC" and not "PATCH" on the subject.
> So there's a difference between "don't care" and "leak memory". It sounds > like you may be using some automated tool that warns because it simply > doesn't understand that difference.
Nope. No automated tool. Just my brain which wanted to fix _all_ occurrences of that prefix_path() usage bug.
But in case anybody uses Valgrind et al. on git, how about at least a comment telling the casual observer why we don't free() the buffers?
Ciao, Dscho