summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Olivier Latour <pol@mac.com>2015-06-30 09:03:23 -0700
committerPierre-Olivier Latour <pol@mac.com>2015-06-30 09:03:23 -0700
commit1630981e6bec6145970952f9ab5c5742ba1449cd (patch)
tree3615e404fe711e5e6d3486726850ea6713d963ef
parent3451c871cb81310cefa41cae8e0e76a4944428a5 (diff)
downloadlibgit2-1630981e6bec6145970952f9ab5c5742ba1449cd.tar.gz
http: fixed leak when asking for credentials again
t->cred might have been allocated the previous time and needs to be freed before asking caller for credentials again.
-rw-r--r--src/transports/http.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/transports/http.c b/src/transports/http.c
index 2110f3226..dd4426475 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,