diff options
author | Pierre-Olivier Latour <pol@mac.com> | 2015-06-30 09:03:23 -0700 |
---|---|---|
committer | Pierre-Olivier Latour <pol@mac.com> | 2015-06-30 09:03:23 -0700 |
commit | 1630981e6bec6145970952f9ab5c5742ba1449cd (patch) | |
tree | 3615e404fe711e5e6d3486726850ea6713d963ef | |
parent | 3451c871cb81310cefa41cae8e0e76a4944428a5 (diff) | |
download | libgit2-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.c | 4 |
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, |