diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-03-04 19:32:07 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-03-04 13:24:18 -0800 |
| commit | a41e8e74674d53a46616b01f2c18e43c7f2f30a8 (patch) | |
| tree | cbc78213d5eae87f1157ee0f35ab673de68ae7f9 /urlmatch.c | |
| parent | diff.c: free "buf" in diff_words_flush() (diff) | |
| download | git-a41e8e74674d53a46616b01f2c18e43c7f2f30a8.tar.gz git-a41e8e74674d53a46616b01f2c18e43c7f2f30a8.zip | |
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.c | 5 |
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); +} |
