ecc: Fix memory leak.
authorWerner Koch <wk@gnupg.org>
Sat, 25 Jun 2016 18:52:47 +0000 (20:52 +0200)
committerWerner Koch <wk@gnupg.org>
Sat, 25 Jun 2016 18:52:47 +0000 (20:52 +0200)
* cipher/ecc.c (ecc_check_secret_key): Do not init point if already
set.

Signed-off-by: Werner Koch <wk@gnupg.org>
cipher/ecc.c

index 8af0d14..e25bf09 100644 (file)
@@ -790,7 +790,8 @@ ecc_check_secret_key (gcry_sexp_t keyparms)
     }
   if (mpi_g)
     {
-      point_init (&sk.E.G);
+      if (!sk.E.G.x)
+        point_init (&sk.E.G);
       rc = _gcry_ecc_os2ec (&sk.E.G, mpi_g);
       if (rc)
         goto leave;