From 1630981e6bec6145970952f9ab5c5742ba1449cd Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Latour Date: Tue, 30 Jun 2015 09:03:23 -0700 Subject: [PATCH] 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. --- src/transports/http.c | 4 ++++ 1 file changed, 4 insertions(+) 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,