"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: memleak in commit_graph
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Mon, 5 Sep 2022 14:51:53 +0200

Download raw body.

Thread
On Mon, Sep 05, 2022 at 02:49:29PM +0200, Omar Polo wrote:
> On 2022/09/05 13:19:33 +0200, Stefan Sperling <stsp@stsp.name> wrote:
> > On Mon, Sep 05, 2022 at 12:26:41PM +0200, Omar Polo wrote:
> > > The idea now is that when calling got_commit_graph_iter_next the
> > > returned pointer is safe until the next call to it.  Most callers were
> > > already doing that, so this is not an invasive change.
> > 
> > Seems fine, for now.
> > 
> > > For a future improvement (post-release) would be fine to make the
> > > callers provide the storage for the got_object_id that iter_next
> > > returns?
> > 
> > Yes, that might be better indeed.
> > 
> > ok for the diff
> 
> I missed that got saves the id returned by iter_next, so something
> like the following is needed too.

Seems fine.

I believe the commit_graph iter ID was passed this way to avoid re-allocating
IDs all the time. But that isn't worth leaking any memory for, of course.