aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <buehler@teamviewer.com>2015-11-12 11:10:32 +0100
committerSteve Holme <steve_holme@hotmail.com>2015-11-12 19:11:40 +0000
commit077fd8f1fa873337b99845805273e11cf968b498 (patch)
tree731e215291b94c836aa1efcbcbe0c0a908662370
parentb6baa108fac4d5c251fd4951867444d7cb92fe96 (diff)
sasl_sspi: fix identity memory leak in digest authentication
-rw-r--r--lib/curl_sasl_sspi.c4
1 files changed, 4 insertions, 0 deletions
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;