]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/blame: fix leaking blame entries with `--incremental`
authorPatrick Steinhardt <ps@pks.im>
Wed, 20 Nov 2024 13:39:30 +0000 (14:39 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Nov 2024 23:23:40 +0000 (08:23 +0900)
commit65a1b7e2bdbdff523f8d55e0036bfad72467bfc8
tree7fe0fed86411935b4f431472a4bc7f78af571356
parent2664f2a0cb18369253acadfa3cb43b1cbf0ae067
builtin/blame: fix leaking blame entries with `--incremental`

When passing `--incremental` to git-blame(1) we exit early by jumping to
the `cleanup` label. But some of the cleanups we perform are handled
between the `goto` and its label, and thus we leak the data.

Move the cleanups after the `cleanup` label. While at it, move the logic
to free the scoreboard's `final_buf` into `cleanup_scoreboard()` and
drop its `const` declaration.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
blame.c
blame.h
builtin/blame.c
t/t8005-blame-i18n.sh