commit | d19ea90f11c657db2c1a4232a40c460eb1a92400 | [log] [tgz] |
---|---|---|
author | Attila Molnar <attilamolnar@hush.com> | Tue Jan 26 11:39:26 2016 +0100 |
committer | Attila Molnar <attilamolnar@hush.com> | Tue Jan 26 11:39:26 2016 +0100 |
tree | fd59974182b246317c42d8b6ad66b82743621e3d | |
parent | bdae02ce90e081a2904f550f069ce7c11565c3dc [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 25a27be..01bd58e 100644 --- a/library/entropy_poll.c +++ b/library/entropy_poll.c
@@ -61,7 +61,10 @@ } if( CryptGenRandom( provider, (DWORD) len, output ) == FALSE ) + { + CryptReleaseContext( provider, 0 ); return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ); + } CryptReleaseContext( provider, 0 ); *olen = len;