From: Taylor Blau Date: Tue, 12 Dec 2023 16:48:12 GMT Subject: Re: [PATCH 02/24] pack-bitmap-write: deep-clear the `bb_commit` slab Message-ID: In-Reply-To: <20231212070406.GA1117953@coredump.intra.peff.net> On Tue, Dec 12, 2023 at 02:04:06AM -0500, Jeff King wrote: > On Tue, Nov 28, 2023 at 02:07:59PM -0500, Taylor Blau wrote: > > > +static void clear_bb_commit(struct bb_commit *commit) > > +{ > > + free(commit->reverse_edges); > > + bitmap_free(commit->commit_mask); > > + bitmap_free(commit->bitmap); > > +} > > I think these bitmaps may sometimes be NULL. But double-checking > bitmap_free(), it sensibly is noop when passed NULL. So this look good > to me. Yeah, bitamp_free() handles a NULL input correctly, so we can pass a possibly-NULL `commit->commit_mask` or `commit->bitmap` argument and be OK. Thanks, Taylor