From: Derrick Stolee Date: Wed, 01 Jul 2026 13:53:29 GMT Subject: Re: [PATCH 1/3] bloom: make bloom-filter slab initialization idempotent Message-ID: In-Reply-To: <20260701063942.GA2580331@coredump.intra.peff.net> On 7/1/2026 2:39 AM, Jeff King wrote: > Before using any of the commit-graph bloom-filter code, somebody needs > to call init_bloom_filters(). This initializes the commit-slab we use > for storing filter information. But we don't want to call it twice > (without a matching deinit call in the middle), since it overwrites the > existing slab pointers, leaking the old values. ... > This patch takes a smaller and more direct route to just dealing with > the potential leak issue. > +static int bloom_filter_slab_initialized; > void init_bloom_filters(void) > { > + if (bloom_filter_slab_initialized) > + return; > init_bloom_filter_slab(&bloom_filters); > + bloom_filter_slab_initialized = 1; > } > { > deep_clear_bloom_filter_slab(&bloom_filters, free_one_bloom_filter); > + bloom_filter_slab_initialized = 0; > } This patch looks like the right fix. Thanks, -Stolee