]> git.ipfire.org Git - thirdparty/git.git/blobdiff - config.c
config: do not leak excludes_file
[thirdparty/git.git] / config.c
index aa2888d301a35f9ccd6d92aaae4ee177926f0424..146856567a6e4b1a9b740c814b92640d831d8268 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1690,8 +1690,10 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
        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)