commit | 2791ba1429947e4f699ea1d253db3815f2f33ff8 | [log] [tgz] |
---|---|---|
author | Attila Molnar <attilamolnar@hush.com> | Tue Jan 26 11:39:26 2016 +0100 |
committer | Simon Butcher <simon.butcher@arm.com> | Mon May 23 14:29:28 2016 +0100 |
tree | 22e1b870abb839ea18ba382b93ebd5b5d3b40161 | |
parent | c8404607eadef9748dfeb9388114eac6dedb9673 [diff] |
Fix handle leak in mbedtls_platform_entropy_poll() on Windows on error
diff --git a/library/entropy_poll.c b/library/entropy_poll.c index 972ad2a..e2f45c7 100644 --- a/library/entropy_poll.c +++ b/library/entropy_poll.c
@@ -67,7 +67,10 @@ } if( CryptGenRandom( provider, (DWORD) len, output ) == FALSE ) + { + CryptReleaseContext( provider, 0 ); return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); + } CryptReleaseContext( provider, 0 ); *olen = len;