mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 17:15:38 +01:00
fix memory leak in mpi_miller_rabin()
Fixes memory leak in mpi_miller_rabin() that occurs when the function has failed to obtain a usable random 'A' 30 turns in a row. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
This commit is contained in:
parent
874b60423e
commit
dfd447e836
@ -2329,7 +2329,8 @@ static int mpi_miller_rabin( const mbedtls_mpi *X, size_t rounds,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count++ > 30) {
|
if (count++ > 30) {
|
||||||
return MBEDTLS_ERR_MPI_NOT_ACCEPTABLE;
|
ret = MBEDTLS_ERR_MPI_NOT_ACCEPTABLE;
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
} while ( mbedtls_mpi_cmp_mpi( &A, &W ) >= 0 ||
|
} while ( mbedtls_mpi_cmp_mpi( &A, &W ) >= 0 ||
|
||||||
|
Loading…
Reference in New Issue
Block a user