Skip to content

Commit

Permalink
sasl_sspi: fix identity memory leak in digest authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
tvbuehler authored and captain-caveman2k committed Nov 12, 2015
1 parent b6baa10 commit 077fd8f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/curl_sasl_sspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 077fd8f

Please sign in to comment.