Re: [PATCH 0/4] fix a leak with excludes_file
- From
Rubén Justo <rjusto@gmail.com>
- Date
- Apr 8, 2024, 19:33 UTC
- Message-ID
- <89a2db74-2bb6-4c62-ad8a-bc4fe5fe49fa@gmail.com>
- In-Reply-To
- <xmqqy19nbvtt.fsf@gitster.g>
On Mon, Apr 08, 2024 at 10:36:30AM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> Rubén Justo <rjusto@gmail.com> 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".