summaryrefslogtreecommitdiff
path: root/t/unit-tests/t-strcmp-offset.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-14 08:52:20 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-14 10:07:59 -0700
commit187b623eeff215b56d8e45ebab1de899e974383a (patch)
tree38e82933b8899238177c0b51f55f6bbe0eec344b /t/unit-tests/t-strcmp-offset.c
parent1ca57bea4a8a4637c4e7d2a2f46677acc4795d81 (diff)
builtin/notes: fix leaking `struct notes_tree` when merging notes
We allocate a `struct notes_tree` in `merge_commit()` which we then initialize via `init_notes()`. It's not really necessary to allocate the structure though given that we never pass ownership to the caller. Furthermore, the allocation leads to a memory leak because despite its name, `free_notes()` doesn't free the `notes_tree` but only clears it. Fix this issue by converting the code to use an on-stack variable. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/t-strcmp-offset.c')
0 files changed, 0 insertions, 0 deletions