mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-26 12:39:55 +00:00
Fix memory leak on error path
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
parent
34c1e7d069
commit
e288ec0651
@ -800,7 +800,10 @@ static int rsa_prepare_blinding( mbedtls_rsa_context *ctx,
|
|||||||
/* Unblinding value: Vf = random number, invertible mod N */
|
/* Unblinding value: Vf = random number, invertible mod N */
|
||||||
do {
|
do {
|
||||||
if( count++ > 10 )
|
if( count++ > 10 )
|
||||||
return( MBEDTLS_ERR_RSA_RNG_FAILED );
|
{
|
||||||
|
ret = MBEDTLS_ERR_RSA_RNG_FAILED;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
MBEDTLS_MPI_CHK( mbedtls_mpi_fill_random( &ctx->Vf, ctx->len - 1, f_rng, p_rng ) );
|
MBEDTLS_MPI_CHK( mbedtls_mpi_fill_random( &ctx->Vf, ctx->len - 1, f_rng, p_rng ) );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user