[PATCH 8/8] ecc-ecdh: fix memory leak

Jussi Kivilinna jussi.kivilinna at iki.fi
Sun Jan 31 17:01:40 CET 2021


* cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Free 'ec' at function exit.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 cipher/ecc-ecdh.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cipher/ecc-ecdh.c b/cipher/ecc-ecdh.c
index 43eb731a..d6b8991a 100644
--- a/cipher/ecc-ecdh.c
+++ b/cipher/ecc-ecdh.c
@@ -122,5 +122,6 @@ _gcry_ecc_mul_point (int curveid, unsigned char *result,
   _gcry_mpi_release (x);
   point_free (&Q);
   _gcry_mpi_release (mpi_k);
+  _gcry_mpi_ec_free (ec);
   return err;
 }
-- 
2.27.0




More information about the Gcrypt-devel mailing list