diff --git a/repo-settings.c b/repo-settings.c index 2dfcb2b654..f220c16f84 100644 --- a/repo-settings.c +++ b/repo-settings.c @@ -15,7 +15,7 @@ void prepare_repo_settings(struct repository *r) { int experimental; int value; - char *strval; + const char *strval; int manyfiles; if (!r->gitdir) @@ -67,7 +67,7 @@ void prepare_repo_settings(struct repository *r) if (!repo_config_get_int(r, "index.version", &value)) r->settings.index_version = value; - if (!repo_config_get_string(r, "core.untrackedcache", &strval)) { + if (!repo_config_get_string_tmp(r, "core.untrackedcache", &strval)) { int v = git_parse_maybe_bool(strval); /* @@ -78,10 +78,9 @@ void prepare_repo_settings(struct repository *r) if (v >= 0) r->settings.core_untracked_cache = v ? UNTRACKED_CACHE_WRITE : UNTRACKED_CACHE_REMOVE; - free(strval); } - if (!repo_config_get_string(r, "fetch.negotiationalgorithm", &strval)) { + if (!repo_config_get_string_tmp(r, "fetch.negotiationalgorithm", &strval)) { int fetch_default = r->settings.fetch_negotiation_algorithm; if (!strcasecmp(strval, "skipping")) r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;