Merge pull request #5576 from lollipopman/double-auth httpclient: only free challenges for current_server type
diff --git a/src/transports/httpclient.c b/src/transports/httpclient.c
index 3c940c9..ee936c8 100644
--- a/src/transports/httpclient.c
+++ b/src/transports/httpclient.c
@@ -1369,8 +1369,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;