summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlosmn@github.com>2016-03-03 20:11:18 +0100
committerCarlos Martín Nieto <carlosmn@github.com>2016-03-03 20:11:18 +0100
commit66a530eb4e4cb7a1ce7a1b8b83fea00659eeea5e (patch)
treef4aa513ac45ecb115dfe09aa3724222f359669d2 /src
parent778fb695ed2a2a0162d83b3fc76bb36fbe2e1799 (diff)
parentba9bb664f3ed3f230c474ddd8937bd072cc9947f (diff)
downloadlibgit2-66a530eb4e4cb7a1ce7a1b8b83fea00659eeea5e.tar.gz
Merge pull request #3648 from libgit2/cmn/auth-retry
test: make sure we retry the auth callback on all platforms
Diffstat (limited to 'src')
-rw-r--r--src/transports/winhttp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c
index ded041686..32b838084 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -926,10 +926,11 @@ replay:
if (parse_unauthorized_response(s->request, &allowed_types, &t->auth_mechanism) < 0)
return -1;
- if (allowed_types &&
- (!t->cred || 0 == (t->cred->credtype & allowed_types))) {
+ if (allowed_types) {
int cred_error = 1;
+ git_cred_free(t->cred);
+ t->cred = NULL;
/* Start with the user-supplied credential callback, if present */
if (t->owner->cred_acquire_cb) {
cred_error = t->owner->cred_acquire_cb(&t->cred, t->owner->url,