diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-09-12 08:38:47 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-09-12 08:38:47 -0700 |
| commit | 7522bb9bc90c6a05ae5f422df723e1cd562dd0bf (patch) | |
| tree | da3fddb312449cf67b6901c310fc7a7a55b8b77d /repo-settings.c | |
| parent | ac8035a2affdf30f2c691ad760826d955bba0507 (diff) | |
| parent | 66eede4a37c3e17ccadbd99fe0f07a4a133d495d (diff) | |
| download | git-7522bb9bc90c6a05ae5f422df723e1cd562dd0bf.tar.gz | |
Merge branch 'jk/plug-list-object-filter-leaks' into jk/list-objects-filter-cleanup
* jk/plug-list-object-filter-leaks:
prepare_repo_settings(): plug leak of config values
list_objects_filter_options: plug leak of filter_spec strings
transport: free filter options in disconnect_git()
transport: deep-copy object-filter struct for fetch-pack
list_objects_filter_copy(): deep-copy sparse_oid_name field
Diffstat (limited to 'repo-settings.c')
| -rw-r--r-- | repo-settings.c | 7 |
1 files changed, 3 insertions, 4 deletions
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; |
