Fix the order of freeing memory
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
parent
61fd1fb4b1
commit
f9728137d8
1 changed files with 5 additions and 5 deletions
|
@ -181,13 +181,13 @@ void mpi_mod_mul( char * input_A,
|
|||
}
|
||||
|
||||
exit:
|
||||
mbedtls_mpi_mod_modulus_free( &m );
|
||||
|
||||
mbedtls_free( rA.p );
|
||||
mbedtls_free( rB.p );
|
||||
mbedtls_free( rR.p );
|
||||
mbedtls_free( X );
|
||||
mbedtls_free( (mbedtls_mpi_uint *) m.p );
|
||||
|
||||
mbedtls_mpi_mod_modulus_free( &m );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
|
@ -233,14 +233,14 @@ void mpi_mod_mul_neg( char * input_A,
|
|||
MBEDTLS_ERR_MPI_BAD_INPUT_DATA );
|
||||
|
||||
exit:
|
||||
mbedtls_mpi_mod_modulus_free( &m );
|
||||
mbedtls_mpi_mod_modulus_free( &fake_m );
|
||||
|
||||
mbedtls_free( rA.p );
|
||||
mbedtls_free( rB.p );
|
||||
mbedtls_free( rR.p );
|
||||
mbedtls_free( X );
|
||||
mbedtls_free( (mbedtls_mpi_uint *) m.p );
|
||||
|
||||
mbedtls_mpi_mod_modulus_free( &m );
|
||||
mbedtls_mpi_mod_modulus_free( &fake_m );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
|
|
Loading…
Reference in a new issue