diff options
| author | Taylor Blau <me@ttaylorr.com> | 2023-12-14 17:23:42 -0500 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-12-14 14:38:07 -0800 |
| commit | 6cdb67b97d188ea5583f33ac09f4649be5f9741f (patch) | |
| tree | d9c0cf5c7c9e317de216f40008cc7f3d469fd09a /builtin/commit.c | |
| parent | pack-objects: free packing_data in more places (diff) | |
| download | git-6cdb67b97d188ea5583f33ac09f4649be5f9741f.tar.gz git-6cdb67b97d188ea5583f33ac09f4649be5f9741f.zip | |
pack-bitmap-write: deep-clear the `bb_commit` slab
The `bb_commit` commit slab is used by the pack-bitmap-write machinery
to track various pieces of bookkeeping used to generate reachability
bitmaps.
Even though we clear the slab when freeing the bitmap_builder struct
(with `bitmap_builder_clear()`), there are still pointers which point to
locations in memory that have not yet been freed, resulting in a leak.
Plug the leak by introducing a suitable `free_fn` for the `struct
bb_commit` type, and make sure it is called on each member of the slab
via the `deep_clear_bb_data()` function.
Note that it is possible for both of the arguments to `bitmap_free()` to
be NULL, but `bitmap_free()` is a noop for NULL arguments, so it is OK
to pass them unconditionally.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions
