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

From: Junio C Hamano <[email-masked]>
Date: Mon, 08 Apr 2024 10:36:30 -0700

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.

And as a stop-gap measure, ...

>> -	if (!strcmp(var, "core.excludesfile"))
>> +	if (!strcmp(var, "core.excludesfile")) {
>> +		free((char *)excludes_file);
>
> Aaah, you prefer this :-( ...  this free is what I was referring to, in
> the message you are replying to, as the simpler fix ...

... obviously this would be much more preferrable.  And when the one
and only true interface comes, we only need to drop the cast from
around here.

Thanks.