From bfc8eb2b78f2b7eaedebea5b9070cf10ef6f73de Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Wed, 20 Feb 2019 17:17:22 +0000 Subject: [PATCH] Revert "ECDH: Fix memory leaks due to context re-initialization" This reverts commit 2340f03c597b923c0f427c76b4c3d2cd11638410. --- library/ecdh.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/library/ecdh.c b/library/ecdh.c index 9c4ddce9c3..f1609bde03 100644 --- a/library/ecdh.c +++ b/library/ecdh.c @@ -162,12 +162,6 @@ int mbedtls_ecdh_compute_shared( mbedtls_ecp_group *grp, mbedtls_mpi *z, static void ecdh_init_internal( mbedtls_ecdh_context_mbed *ctx ) { - mbedtls_ecp_group_free( &ctx->grp ); - mbedtls_mpi_free( &ctx->d ); - mbedtls_ecp_point_free( &ctx->Q ); - mbedtls_ecp_point_free( &ctx->Qp ); - mbedtls_mpi_free( &ctx->z ); - mbedtls_ecp_group_init( &ctx->grp ); mbedtls_mpi_init( &ctx->d ); mbedtls_ecp_point_init( &ctx->Q ); @@ -175,7 +169,6 @@ static void ecdh_init_internal( mbedtls_ecdh_context_mbed *ctx ) mbedtls_mpi_init( &ctx->z ); #if defined(MBEDTLS_ECP_RESTARTABLE) - mbedtls_ecp_restart_free( &ctx->rs ); mbedtls_ecp_restart_init( &ctx->rs ); #endif }