Fix handle leak in mbedtls_platform_entropy_poll() on Windows on error
This commit is contained in:
parent
bdae02ce90
commit
d19ea90f11
1 changed files with 3 additions and 0 deletions
|
@ -61,7 +61,10 @@ int mbedtls_platform_entropy_poll( void *data, unsigned char *output, size_t len
|
|||
}
|
||||
|
||||
if( CryptGenRandom( provider, (DWORD) len, output ) == FALSE )
|
||||
{
|
||||
CryptReleaseContext( provider, 0 );
|
||||
return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
|
||||
}
|
||||
|
||||
CryptReleaseContext( provider, 0 );
|
||||
*olen = len;
|
||||
|
|
Loading…
Reference in a new issue