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:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-03-04 21:32:07 +0300
committerJunio C Hamano <gitster@pobox.com>2022-03-05 00:24:18 +0300
commita41e8e74674d53a46616b01f2c18e43c7f2f30a8 (patch)
treecbc78213d5eae87f1157ee0f35ab673de68ae7f9 /urlmatch.c
parenta18d66cefb9e5ee4fd49be1d60e90523cd89ca0f (diff)
urlmatch.c: add and use a *_release() function
Plug a memory leak in credential_apply_config() by adding and using a new urlmatch_config_release() function. This just does a string_list_clear() on the "vars" member. This finished up work on normalizing the init/free pattern in this API, started in 73ee449bbf2 (urlmatch.[ch]: add and use URLMATCH_CONFIG_INIT, 2021-10-01). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'urlmatch.c')
-rw-r--r--urlmatch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/urlmatch.c b/urlmatch.c
index 03ad3f30a9..b615adc923 100644
--- a/urlmatch.c
+++ b/urlmatch.c
@@ -611,3 +611,8 @@ int urlmatch_config_entry(const char *var, const char *value, void *cb)
strbuf_release(&synthkey);
return retval;
}
+
+void urlmatch_config_release(struct urlmatch_config *config)
+{
+ string_list_clear(&config->vars, 1);
+}