Commit 2ab99c6d0a773f00f2d62933d0a0866071edf275

Edward Thomson 2020-10-04T18:30:10

Merge pull request #5576 from lollipopman/double-auth httpclient: only free challenges for current_server type

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;