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
This commit is contained in:
Junio C Hamano
2024-04-15 14:11:44 -07:00
2 changed files with 4 additions and 1 deletions

View File

@ -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)