mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-22 20:51:06 +00:00
Merge pull request #409 from attilamolnar/fix-handle-leak
Fix handle leak in mbedtls_platform_entropy_poll() on Windows on error
This commit is contained in:
commit
e1fbac4ac4
|
@ -67,7 +67,10 @@ int mbedtls_platform_entropy_poll( void *data, unsigned char *output, size_t len
|
||||||
}
|
}
|
||||||
|
|
||||||
if( CryptGenRandom( provider, (DWORD) len, output ) == FALSE )
|
if( CryptGenRandom( provider, (DWORD) len, output ) == FALSE )
|
||||||
|
{
|
||||||
|
CryptReleaseContext( provider, 0 );
|
||||||
return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
|
return( MBEDTLS_ERR_ENTROPY_SOURCE_FAILED );
|
||||||
|
}
|
||||||
|
|
||||||
CryptReleaseContext( provider, 0 );
|
CryptReleaseContext( provider, 0 );
|
||||||
*olen = len;
|
*olen = len;
|
||||||
|
|
Loading…
Reference in a new issue