diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2016-07-20 22:00:45 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2016-07-20 22:00:45 -0400 |
commit | c5cffce56e4c6f6c26e82438a61abf85e39cac4a (patch) | |
tree | 9f1af53a640f44b19311cf9166173d14374c987e /lib | |
parent | dcdd4be35213d4ba36e41ad92fe2ae4ddab1205d (diff) |
vauth: Fix memleak by freeing credentials if out of memory
This is a follow up to the parent commit dcdd4be which fixes one leak
but creates another by failing to free the credentials handle if out of
memory. Also there's a second location a few lines down where we fail to
do same. This commit fixes both of those issues.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vauth/digest_sspi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index fc37db0c5..6a7315eb5 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -420,7 +420,10 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, by the security package */ output_token = malloc(token_max); if(!output_token) { + s_pSecFn->FreeCredentialsHandle(&credentials); + Curl_sspi_free_identity(p_identity); + return CURLE_OUT_OF_MEMORY; } @@ -448,6 +451,8 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, spn = Curl_convert_UTF8_to_tchar((char *) uripath); if(!spn) { + s_pSecFn->FreeCredentialsHandle(&credentials); + Curl_sspi_free_identity(p_identity); free(output_token); |