Skip to content

Commit b415f15

Browse files
committed
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
2 parents eba498a + 0e0fefb commit b415f15

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

config.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,8 +1584,10 @@ static int git_default_core_config(const char *var, const char *value,
15841584
if (!strcmp(var, "core.askpass"))
15851585
return git_config_string(&askpass_program, var, value);
15861586

1587-
if (!strcmp(var, "core.excludesfile"))
1587+
if (!strcmp(var, "core.excludesfile")) {
1588+
free((char *)excludes_file);
15881589
return git_config_pathname(&excludes_file, var, value);
1590+
}
15891591

15901592
if (!strcmp(var, "core.whitespace")) {
15911593
if (!value)

t/t7300-clean.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
test_description='git clean basic tests'
77

8+
TEST_PASSES_SANITIZE_LEAK=true
89
. ./test-lib.sh
910

1011
git config clean.requireForce no

0 commit comments

Comments
 (0)