summaryrefslogtreecommitdiff
path: root/cipher/ecc.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-06-25 20:52:47 +0200
committerWerner Koch <wk@gnupg.org>2016-06-25 20:52:47 +0200
commit7a7f7c147f888367dfee6093d26bfeaf750efc3a (patch)
treefe0b8be4e31c92985732c4ee50ea6a0f375d6281 /cipher/ecc.c
parent1feb01940062a74c27230434fc3babdddca8caf4 (diff)
downloadlibgcrypt-7a7f7c147f888367dfee6093d26bfeaf750efc3a.tar.gz
ecc: Fix memory leak.
* cipher/ecc.c (ecc_check_secret_key): Do not init point if already set. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'cipher/ecc.c')
-rw-r--r--cipher/ecc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cipher/ecc.c b/cipher/ecc.c
index 8af0d141..e25bf095 100644
--- a/cipher/ecc.c
+++ b/cipher/ecc.c
@@ -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;