aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-04-15 14:11:44 -0700
committerJunio C Hamano <gitster@pobox.com>2024-04-15 14:11:44 -0700
commitb415f15b491e66da7eccbf896193808d5746988e (patch)
tree6749a7329320eb1158b576482296e9285dc414bd
parenteba498a77463e9d24c19c8d9473fd2152d5840c4 (diff)
parent0e0fefb29fde59b6703d3b45987823fe85c00706 (diff)
downloadgit-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.c4
-rwxr-xr-xt/t7300-clean.sh1
2 files changed, 4 insertions, 1 deletions
diff --git a/config.c b/config.c
index eebce8c7e0..ae3652b08f 100644
--- a/config.c
+++ b/config.c
@@ -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