diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-04-15 14:11:44 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-15 14:11:44 -0700 |
commit | b415f15b491e66da7eccbf896193808d5746988e (patch) | |
tree | 6749a7329320eb1158b576482296e9285dc414bd | |
parent | eba498a77463e9d24c19c8d9473fd2152d5840c4 (diff) | |
parent | 0e0fefb29fde59b6703d3b45987823fe85c00706 (diff) | |
download | git-b415f15b491e66da7eccbf896193808d5746988e.tar.gz |
Merge branch 'jc/unleak-core-excludesfile'
The variable that holds the value read from the core.excludefile
configuration variable used to leak, which has been corrected.
* jc/unleak-core-excludesfile:
config: do not leak excludes_file
-rw-r--r-- | config.c | 4 | ||||
-rwxr-xr-x | t/t7300-clean.sh | 1 |
2 files changed, 4 insertions, 1 deletions
@@ -1584,8 +1584,10 @@ static int git_default_core_config(const char *var, const char *value, if (!strcmp(var, "core.askpass")) return git_config_string(&askpass_program, var, value); - if (!strcmp(var, "core.excludesfile")) + if (!strcmp(var, "core.excludesfile")) { + free((char *)excludes_file); return git_config_pathname(&excludes_file, var, value); + } if (!strcmp(var, "core.whitespace")) { if (!value) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 1f7201eb60..0aae0dee67 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -5,6 +5,7 @@ test_description='git clean basic tests' +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh git config clean.requireForce no |