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

Re: [PATCH] remote: plug memory leaks

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 25, 2026, 01:57 UTC
Message-ID
<xmqqbjbv3k7i.fsf@gitster.g>
In-Reply-To
<xmqqv7a33nm9.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> The in-core data structure used to keep track of
> 'url.<real>.{insteadOf,pushInsteadOf} = <alias>' settings is not
> properly cleaned up when the process is done with it.
>
> Fix the rewrites_release() function to free not just the 'struct
> rewrites' instance itself, but also allocated structures that are
> pointed at by the 'struct rewrites' instance.  One of the embedded
> structures holds a 'const char *' to point at a borrowed constant
> string from a configuration callback.  Since the code does not
> modify this string, stop copying the value (alias URL) before
> registering it in 'struct rewrite', as nobody is freeing this
> member, to avoid leaking the extra copy.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>
>  * These are not recently introduced leaks as far as I can tell, but
>    the new tests in en/submodule-insteadof-remote-match expose them.

It is unfortunately rare to see all CI jobs pass, but today is one of those days ;-)

With this, and everything in 'seen' reported in the last edition of the "What's cooking" report, excluding the 'tn/packfile-uri-concurrency' topic, CI passes all jobs.

  https://github.com/git/git/actions/runs/30137079882/

'tn/packfile-uri-concurrency' was tentatively excluded from the above as I made a random guess at who the culprit for the t5550 failure in

  https://github.com/git/git/actions/runs/30130205851/job/89602846186

for the SHA-256 CI job was. I have merged the topic back into 'seen', and the resulting CI run for 'seen' is here:

  https://github.com/git/git/actions/runs/30138777784/
It has not finished running, so we'll see how it goes.
Thanks.
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 5 in “remote: plug memory leaks”
  1. remote: plug memory leaksJunio C Hamano, Jul 25, 2026
  2. Junio C HamanoJul 25, 2026
  3. remote: plug memory leaksJunio C Hamano, Jul 25, 2026
  4. Jeff KingJul 25, 2026
  5. Junio C HamanoJul 25, 2026

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.