Remove unnecessary calls to init() from free()

Our API makes no guarantee that you can use a context after free()ing it
without re-init()ing it first, so better not give the wrong impression that we
do, while it's not policy and the rest of the code might not allow it.
This commit is contained in:
Manuel Pégourié-Gonnard 2018-10-16 10:34:13 +02:00
parent c37423fa76
commit d8b73f2312
2 changed files with 0 additions and 4 deletions

View file

@ -161,8 +161,6 @@ void mbedtls_ecdh_free( mbedtls_ecdh_context *ctx )
#if defined(MBEDTLS_ECP_RESTARTABLE) #if defined(MBEDTLS_ECP_RESTARTABLE)
mbedtls_ecp_restart_free( &ctx->rs ); mbedtls_ecp_restart_free( &ctx->rs );
#endif #endif
mbedtls_ecdh_init( ctx );
} }
#if defined(MBEDTLS_ECP_RESTARTABLE) #if defined(MBEDTLS_ECP_RESTARTABLE)

View file

@ -126,8 +126,6 @@ static void ecdsa_restart_sig_free( mbedtls_ecdsa_restart_sig_ctx *ctx )
mbedtls_mpi_free( &ctx->k ); mbedtls_mpi_free( &ctx->k );
mbedtls_mpi_free( &ctx->r ); mbedtls_mpi_free( &ctx->r );
ecdsa_restart_sig_init( ctx );
} }
#if defined(MBEDTLS_ECDSA_DETERMINISTIC) #if defined(MBEDTLS_ECDSA_DETERMINISTIC)