git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 8, 2024, 17:36 UTC
Message-ID
<xmqqy19nbvtt.fsf@gitster.g>
In-Reply-To
<1323321b-554e-4b16-a814-03710c50db99@gmail.com>
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.

And as a stop-gap measure, ...
Show 6 quoted lines
>> -	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.
Previous: Rubén JustoNext: Rubén Justo
Message 8 of 9 in “fix a leak with excludes_file”
  1. 0/4 fix a leak with excludes_fileRubén Justo, Apr 6, 2024
  2. 1/4 path.c: introduce strbuf_interpolate_pathRubén Justo, Apr 6, 2024
  3. 2/4 config.c: introduce git_config_strbuf_pathnameRubén Justo, Apr 6, 2024
  4. 3/4 environment.c: convert excludes_file to struct strbufRubén Justo, Apr 6, 2024
  5. 4/4 t7300: mark as leak-freeRubén Justo, Apr 6, 2024
  6. Junio C HamanoApr 6, 2024
  7. Rubén JustoApr 7, 2024
  8. Junio C HamanoApr 8, 2024
  9. Rubén JustoApr 8, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.