sideband: fix leaks when configuring sideband colors

We read a bunch of configs in `use_sideband_colors()` to configure the
colors that Git should use. We never free the strings read from the
config though, causing memory leaks.

Refactor the code to use `git_config_get_string_tmp()` instead, which
does not allocate memory. As we throw the strings away after parsing
them anyway there is no need to use allocated strings.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-08-22 11:17:49 +02:00
committed by Junio C Hamano
parent a09efb74e3
commit 2a2d5da1f2
2 changed files with 8 additions and 8 deletions

View File

@ -2,6 +2,7 @@
test_description='remote messages are colorized on the client'
TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '