Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb58fb2

Browse files
committed
Merge pull request libgit2#3275 from git-up/http_fix
http: fixed leak when asking for credentials again
2 parents 3451c87 + 1630981 commit cb58fb2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/transports/http.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ static int on_headers_complete(http_parser *parser)
337337
no_callback = 1;
338338
} else {
339339
if (allowed_auth_types) {
340+
if (t->cred) {
341+
t->cred->free(t->cred);
342+
t->cred = NULL;
343+
}
340344

341345
error = t->owner->cred_acquire_cb(&t->cred,
342346
t->owner->url,

0 commit comments

Comments
 (0)