Re: [PATCH 02/24] pack-bitmap-write: deep-clear the `bb_commit` slab
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Nov 30, 2023, 19:11 UTC
- Message-ID
- <ZWjeYP2vGTyAuQo+@nand.local>
- In-Reply-To
- <ZWhhd5gLzYwPEgBl@tanuki>
On Thu, Nov 30, 2023 at 11:18:31AM +0100, Patrick Steinhardt wrote:
Show 14 quoted lines
> > diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
> > index f4ecdf8b0e..dd3a415b9d 100644
> > --- a/pack-bitmap-write.c
> > +++ b/pack-bitmap-write.c
> > @@ -198,6 +198,13 @@ struct bb_commit {
> > unsigned idx; /* within selected array */
> > };
> >
> > +static void clear_bb_commit(struct bb_commit *commit)
> > +{
> > + free(commit->reverse_edges);
>
> I'd have expected to see `free_commit_list()` here instead of a simple
> free. Is there any reason why we don't use it?Thanks for spotting an oversight on my part. We should definitely be using free_commit_list() here instead of a bare free() to avoid leaking the tail.
Thanks, Taylor