mirror of
https://github.com/espressif/mbedtls.git
synced 2025-06-26 03:24:35 +08:00
Minor improvements to ecp.c changes
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
9430330d2f
commit
e9af9e3e12
@ -2395,12 +2395,12 @@ cleanup:
|
|||||||
mbedtls_free( T );
|
mbedtls_free( T );
|
||||||
}
|
}
|
||||||
|
|
||||||
int should_free_R = 0;
|
|
||||||
/* prevent caller from using invalid value */
|
/* prevent caller from using invalid value */
|
||||||
should_free_R = ( ret != 0 );
|
int should_free_R = ( ret != 0 );
|
||||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||||
/* don't free R while in progress in case R == P */
|
/* don't free R while in progress in case R == P */
|
||||||
should_free_R = should_free_R && ( ret != MBEDTLS_ERR_ECP_IN_PROGRESS );
|
if( ret == MBEDTLS_ERR_ECP_IN_PROGRESS )
|
||||||
|
should_free_R = 0;
|
||||||
#endif
|
#endif
|
||||||
if( should_free_R )
|
if( should_free_R )
|
||||||
mbedtls_ecp_point_free( R );
|
mbedtls_ecp_point_free( R );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user