diff options
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -211,12 +211,12 @@ static int http_options(const char *var, const char *value, void *cb) static void init_curl_http_auth(CURL *result) { if (http_auth.username) { - struct strbuf up = STRBUF_INIT; + static struct strbuf up = STRBUF_INIT; credential_fill(&http_auth); + strbuf_reset(&up); strbuf_addf(&up, "%s:%s", http_auth.username, http_auth.password); - curl_easy_setopt(result, CURLOPT_USERPWD, - strbuf_detach(&up, NULL)); + curl_easy_setopt(result, CURLOPT_USERPWD, up.buf); } } |