Subject: Re: [PATCH 3/3] odb: properly close sources before freeing them

From: Patrick Steinhardt <[email-masked]>
Date: Sat, 6 Dec 2025 13:04:10 +0100

On Sat, Dec 06, 2025 at 06:43:40AM -0500, Eric Sunshine wrote:
> On Sat, Dec 6, 2025 at 6:38 AM Patrick Steinhardt <[email-masked]> wrote:
> > On Fri, Dec 05, 2025 at 06:14:22PM -0500, Eric Sunshine wrote:
> > > On Fri, Dec 5, 2025 at 6:36 AM Patrick Steinhardt <[email-masked]> wrote:
> > > > In the next commit we are about to move the packfile store into the ODB
> > > > source so that we have one store per source. This will lead to a memory
> > > > leak in the following commit when reading data from a submodule via
> > > > git-grep(1):
> > > > [...]
> > > > Signed-off-by: Patrick Steinhardt <[email-masked]>
> > >
> > > Considering that this is patch [3/3], to what does "In the next
> > > commit..." refer?
> >
> > Good catch! I split this out of another, bigger, patch series. But as
> > I've started to hit the leak in a different patch series, as well, I
> > decided to split it out into a smaller patch series.
> >
> > I've queued the following change locally, but will refrain from sending
> > out a new version for now.
> >
> > 3:  a06d0716c3 ! 3:  c9ca233c29 odb: properly close sources before freeing them
> >     @@ Commit message
> >          In the next commit we are about to move the packfile store into the ODB
> >     -    source so that we have one store per source. This will lead to a memory
> >     -    leak in the following commit when reading data from a submodule via
> >     -    git-grep(1):
> >     +    source so that we have one store per source. This can lead to a memory
> >     +    leak when reading data from a submodule via git-grep(1):
> 
> I would think that you would also want to drop the "In the next commit
> we are about to..." bit (considering, again, that this is patch
> [3/3]).

Ugh, of course. It's the weekend, so my brain is clearly not working.
Thanks!

Patrick