Commit cb58fb24f5d90878a6280a3c6e5d93bf92247cf1

Edward Thomson 2015-06-30T13:39:07

Merge pull request #3275 from git-up/http_fix http: fixed leak when asking for credentials again

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/transports/http.c b/src/transports/http.c
index 2110f32..dd44264 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -337,6 +337,10 @@ static int on_headers_complete(http_parser *parser)
 			no_callback = 1;
 		} else {
 			if (allowed_auth_types) {
+				if (t->cred) {
+					t->cred->free(t->cred);
+					t->cred = NULL;
+				}
 
 				error = t->owner->cred_acquire_cb(&t->cred,
 								  t->owner->url,