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

Re: [PATCH] commit-graph: fix memory leak when not writing graph

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 15, 2024, 07:08 UTC
Message-ID
<ZaTaBN2Xc61sVvTJ@tanuki>
In-Reply-To
<ZZhUWu5pgBEYK409@nand.local>
On Fri, Jan 05, 2024 at 02:11:22PM -0500, Taylor Blau wrote:
Show 12 quoted lines
> On Mon, Dec 18, 2023 at 11:02:28AM +0100, Patrick Steinhardt wrote:
> > When `write_commit_graph()` bails out writing a split commit-graph early
> > then it may happen that we have already gathered the set of existing
> > commit-graph file names without yet determining the new merged set of
> > files. This can result in a memory leak though because we only clear the
> > preimage of files when we have collected the postimage.
> >
> > Fix this issue by dropping the condition altogether so that we always
> > try to free both preimage and postimage filenames. As the context
> > structure is zero-initialized this simplification is safe to do.
> 
> Looks obviously good to me, thanks for finding and fixing.

Cc'ing Junio so that this fix doesn't fall off the radar. I thought I saw the topic in "seen" once, but either I misremember or it got dropped from there.

Patrick
Previous: Taylor Blau
Message 3 of 3 in “commit-graph: fix memory leak when not writing graph”
  1. commit-graph: fix memory leak when not writing graphPatrick Steinhardt, Dec 18, 2023
  2. Taylor BlauJan 5, 2024
  3. Patrick SteinhardtJan 15, 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.