diff options
author | Werner Koch <wk@gnupg.org> | 2016-06-25 20:52:47 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2016-06-25 20:52:47 +0200 |
commit | 7a7f7c147f888367dfee6093d26bfeaf750efc3a (patch) | |
tree | fe0b8be4e31c92985732c4ee50ea6a0f375d6281 /cipher/ecc.c | |
parent | 1feb01940062a74c27230434fc3babdddca8caf4 (diff) | |
download | libgcrypt-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.c | 3 |
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; |