Merge branch 'mh/http-urlmatch-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Sep 2019 04:19:24 +0000 (13:19 +0900)
Leakfix.

* mh/http-urlmatch-cleanup:
  http: don't leak urlmatch_config.vars

1  2 
http.c

diff --combined http.c
--- 1/http.c
--- 2/http.c
+++ b/http.c
@@@ -513,11 -513,9 +513,11 @@@ static void set_proxyauth_name_password
  #else
                struct strbuf s = STRBUF_INIT;
  
 -              strbuf_addstr_urlencode(&s, proxy_auth.username, 1);
 +              strbuf_addstr_urlencode(&s, proxy_auth.username,
 +                                      is_rfc3986_unreserved);
                strbuf_addch(&s, ':');
 -              strbuf_addstr_urlencode(&s, proxy_auth.password, 1);
 +              strbuf_addstr_urlencode(&s, proxy_auth.password,
 +                                      is_rfc3986_unreserved);
                curl_proxyuserpwd = strbuf_detach(&s, NULL);
                curl_easy_setopt(result, CURLOPT_PROXYUSERPWD, curl_proxyuserpwd);
  #endif
@@@ -1075,6 -1073,7 +1075,7 @@@ void http_init(struct remote *remote, c
  
        git_config(urlmatch_config_entry, &config);
        free(normalized_url);
+       string_list_clear(&config.vars, 1);
  
  #if LIBCURL_VERSION_NUM >= 0x073800
        if (http_ssl_backend) {