Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-09-14 22:56:40 +0300
committerJunio C Hamano <gitster@pobox.com>2022-09-14 22:56:40 +0300
commit08d61c70613fc340d983283fc6c3b2e4059bb58b (patch)
treed39f5ad40e63cb621842628347b10d4186a1ac4d /repo-settings.c
parentb563638d2cf5d02af72447495a4d4173c6d1cd33 (diff)
parent66eede4a37c3e17ccadbd99fe0f07a4a133d495d (diff)
Merge branch 'jk/plug-list-object-filter-leaks'
The code that manages list-object-filter structure, used in partial clones, leaked the instances, which has been plugged. * 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.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/repo-settings.c b/repo-settings.c
index 43bc881bfc..e8b58151bc 100644
--- a/repo-settings.c
+++ b/repo-settings.c
@@ -22,7 +22,7 @@ void prepare_repo_settings(struct repository *r)
{
int experimental;
int value;
- char *strval;
+ const char *strval;
int manyfiles;
if (!r->gitdir)
@@ -77,7 +77,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);
/*
@@ -88,10 +88,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;