Subject: Re: [PATCH 0/4] fix a leak with excludes_file

From: Rubén Justo <[email-masked]>
Date: Mon, 8 Apr 2024 21:33:50 +0200

On Mon, Apr 08, 2024 at 10:36:30AM -0700, Junio C Hamano wrote:
> Rubén Justo <[email-masked]> writes:
> 
> > It does not have to be like that.  We may no longer need the current
> > and problematic git_config_pathname().  However I did not want to go
> > that far in this series.
> 
> True, but that one and only true interface we will end up with MUST
> NOT be strbuf based one, and that is why I said the patch as posted
> will not take us into a better future.

It doesn't have to be having a strbuf-based-only interface, either.

It is about introducing an interface where callers:

	- can take advantage of a not-always-allocate interface, and

	- can stop worrying about freeing previous values, when reusing
	  variables.

This latter fixes the leak while the former introduces a nice "if you
set n-times the same value, we'll allocate once".