aboutsummaryrefslogtreecommitdiff
path: root/lib/http_negotiate_sspi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/http_negotiate_sspi.c')
-rw-r--r--lib/http_negotiate_sspi.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/http_negotiate_sspi.c b/lib/http_negotiate_sspi.c
index fd0f81781..8ec3bbc91 100644
--- a/lib/http_negotiate_sspi.c
+++ b/lib/http_negotiate_sspi.c
@@ -258,25 +258,30 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
static void cleanup(struct negotiatedata *neg_ctx)
{
+ /* Free our security context */
if(neg_ctx->context) {
s_pSecFn->DeleteSecurityContext(neg_ctx->context);
free(neg_ctx->context);
neg_ctx->context = NULL;
}
+ /* Free our credentials handle */
if(neg_ctx->credentials) {
s_pSecFn->FreeCredentialsHandle(neg_ctx->credentials);
free(neg_ctx->credentials);
neg_ctx->credentials = NULL;
}
- neg_ctx->token_max = 0;
- Curl_safefree(neg_ctx->output_token);
+ /* Free our identity */
+ Curl_sspi_free_identity(neg_ctx->p_identity);
+ neg_ctx->p_identity = NULL;
+ /* Free the SPN and output token */
Curl_safefree(neg_ctx->server_name);
+ Curl_safefree(neg_ctx->output_token);
- Curl_sspi_free_identity(neg_ctx->p_identity);
- neg_ctx->p_identity = NULL;
+ /* Reset any variables */
+ neg_ctx->token_max = 0;
}
void Curl_cleanup_negotiate(struct SessionHandle *data)