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.
This commit is contained in:
Pierre-Olivier Latour 2015-06-30 09:03:23 -07:00
parent 3451c871cb
commit 1630981e6b

View File

@ -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,