aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
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 /config.c
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
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 3 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)