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
1 changed files with 4 additions and 1 deletions
|
@ -800,7 +800,10 @@ static int rsa_prepare_blinding( mbedtls_rsa_context *ctx,
|
|||
/* Unblinding value: Vf = random number, invertible mod N */
|
||||
do {
|
||||
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 ) );
|
||||
|
||||
|
|
Loading…
Reference in a new issue