From 077fd8f1fa873337b99845805273e11cf968b498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Thu, 12 Nov 2015 11:10:32 +0100 Subject: [PATCH] sasl_sspi: fix identity memory leak in digest authentication --- lib/curl_sasl_sspi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/curl_sasl_sspi.c b/lib/curl_sasl_sspi.c index 84fce9f24..6fb7b5f52 100644 --- a/lib/curl_sasl_sspi.c +++ b/lib/curl_sasl_sspi.c @@ -463,6 +463,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, p_identity, NULL, NULL, &credentials, &expiry); if(status != SEC_E_OK) { + Curl_sspi_free_identity(p_identity); free(output_token); return CURLE_LOGIN_DENIED; @@ -492,6 +493,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, spn = Curl_convert_UTF8_to_tchar((char *) uripath); if(!spn) { + Curl_sspi_free_identity(p_identity); free(output_token); return CURLE_OUT_OF_MEMORY; @@ -511,6 +513,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) { s_pSecFn->FreeCredentialsHandle(&credentials); + Curl_sspi_free_identity(p_identity); free(output_token); return CURLE_OUT_OF_MEMORY; @@ -521,6 +524,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, s_pSecFn->DeleteSecurityContext(&context); s_pSecFn->FreeCredentialsHandle(&credentials); + Curl_sspi_free_identity(p_identity); free(output_token); return CURLE_OUT_OF_MEMORY;