1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-11-27 11:41:17 +03:00

Fix leak of modulus structures in tests

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2022-12-08 19:50:29 +01:00
parent a57cf9813a
commit d008abbc4f
3 changed files with 16 additions and 2 deletions

View File

@@ -102,6 +102,12 @@ int mbedtls_test_read_mpi_modulus( mbedtls_mpi_mod_modulus *N,
return( ret );
}
void mbedtls_test_mpi_mod_modulus_free_with_limbs( mbedtls_mpi_mod_modulus *N )
{
mbedtls_free( (mbedtls_mpi_uint*) N->p );
mbedtls_mpi_mod_modulus_free( N );
}
int mbedtls_test_read_mpi( mbedtls_mpi *X, const char *s )
{
int negative = 0;