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>
This commit is contained in:

committed by
Junio C Hamano

parent
f9c1989674
commit
a6cb0cc610
@ -64,7 +64,7 @@ char *excludes_file;
|
||||
enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
|
||||
enum eol core_eol = EOL_UNSET;
|
||||
int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN;
|
||||
const char *check_roundtrip_encoding = "SHIFT-JIS";
|
||||
char *check_roundtrip_encoding;
|
||||
enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;
|
||||
enum rebase_setup_type autorebase = AUTOREBASE_NEVER;
|
||||
enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
|
||||
|
Reference in New Issue
Block a user