]> git.ipfire.org Git - thirdparty/git.git/commit
convert: refactor code to clarify ownership of check_roundtrip_encoding
authorPatrick Steinhardt <ps@pks.im>
Mon, 27 May 2024 11:46:25 +0000 (13:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 May 2024 18:19:59 +0000 (11:19 -0700)
commita6cb0cc61033d10eb948057c45dea25c1ab8e151
tree2d5b443acc17c1a5b497ad903eef4a4615240ef7
parentf9c19896749912da7add7ef855ea0543cca91bef
convert: refactor code to clarify ownership of check_roundtrip_encoding

The `check_roundtrip_encoding` variable is tracked in a `const char *`
even though it may contain allocated strings at times. The result is
that those strings may be leaking because we never free them.

Refactor the code to always store allocated strings in this variable.
The default value is handled in `check_roundtrip()` now, which is the
only user of the variable.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c
convert.c
convert.h
environment.c