summaryrefslogtreecommitdiffstats
path: root/g10/keygen.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-12-12 14:02:14 +0100
committerWerner Koch <wk@gnupg.org>2016-12-12 14:02:14 +0100
commit98433c70431dfbde99b0e89416856d1eef9ebc88 (patch)
tree4846ed9b70f0f5a82512ed89e1919212de13db6f /g10/keygen.c
parentgpg: Do not use a fixed string for --gpgconf-list:default_pubkey_algo. (diff)
downloadgnupg2-98433c70431dfbde99b0e89416856d1eef9ebc88.tar.xz
gnupg2-98433c70431dfbde99b0e89416856d1eef9ebc88.zip
gpg: Fix memory leak in ecc key generation.
* g10/keygen.c (ecckey_from_sexp): Release curve. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/keygen.c')
-rw-r--r--g10/keygen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index c1abc70cc..c93708438 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -1102,7 +1102,7 @@ ecckey_from_sexp (gcry_mpi_t *array, gcry_sexp_t sexp, int algo)
{
gpg_error_t err;
gcry_sexp_t list, l2;
- char *curve;
+ char *curve = NULL;
int i;
const char *oidstr;
unsigned int nbits;
@@ -1171,6 +1171,7 @@ ecckey_from_sexp (gcry_mpi_t *array, gcry_sexp_t sexp, int algo)
}
leave:
+ xfree (curve);
if (err)
{
for (i=0; i < 3; i++)