Commit bd346313 by Jesse Hathaway

httpclient: only free challenges for current_server type

Prior to this commit we freed both the server and proxy auth challenges
in git_http_client_read_response. This works when the proxy needs auth
or when the server needs auth, but it does not work when both the proxy
and the server need auth as we erroneously remove the server auth
challenge before we have added them as server credentials. Instead only
remove the challenges for the current_server type.

Co-authored-by: Stephen Gelman <ssgelm@gmail.com>
parent 8720ae8a
......@@ -1374,8 +1374,11 @@ int git_http_client_read_response(
git_http_response_dispose(response);
git_vector_free_deep(&client->server.auth_challenges);
git_vector_free_deep(&client->proxy.auth_challenges);
if (client->current_server == PROXY) {
git_vector_free_deep(&client->proxy.auth_challenges);
} else if(client->current_server == SERVER) {
git_vector_free_deep(&client->server.auth_challenges);
}
client->state = READING_RESPONSE;
client->keepalive = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment