threads / patch / 51738

patchhttp: don't leak urlmatch_config.vars

Subject: [PATCH] http: don't leak urlmatch_config.vars

## tl;dr

2 messages between Aug 26, 2019 and Aug 26, 2019. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Mike Hommey· Aug 26, 2019, 07:49 UTC · lore
Signed-off-by: Mike Hommey <mh@glandium.org>
---
 http.c | 1 +
 1 file changed, 1 insertion(+)
Show changes to http.c +1 −0
diff --git a/http.c b/http.c
index 27aa0a3192..9e33584f2d 100644
--- a/http.c
+++ b/http.c
@@ -1073,6 +1073,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
 
 	git_config(urlmatch_config_entry, &config);
 	free(normalized_url);
+	string_list_clear(&config.vars, 1);
 
 #if LIBCURL_VERSION_NUM >= 0x073800
 	if (http_ssl_backend) {
-- 
2.23.0
Junio C Hamano· Aug 26, 2019, 18:09 UTC · re: Mike Hommey · lore

Re: [PATCH] http: don't leak urlmatch_config.vars

Mike Hommey <mh@glandium.org> writes:
> Signed-off-by: Mike Hommey <mh@glandium.org>
> ---
>  http.c | 1 +
>  1 file changed, 1 insertion(+)

This matches what builtin/config.c::get_urlmatch() does, which makes sense.

Thanks.
Show 13 quoted lines
>
> diff --git a/http.c b/http.c
> index 27aa0a3192..9e33584f2d 100644
> --- a/http.c
> +++ b/http.c
> @@ -1073,6 +1073,7 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
>  
>  	git_config(urlmatch_config_entry, &config);
>  	free(normalized_url);
> +	string_list_clear(&config.vars, 1);
>  
>  #if LIBCURL_VERSION_NUM >= 0x073800
>  	if (http_ssl_backend) {

← back to recent threads