From 68bf547f9c46aa537564f6af896670687cfb46f5 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Sun, 9 Jul 2017 16:02:11 +0200 Subject: [PATCH] use rsa_free() on error in rsa_make_key() --- src/pk/rsa/rsa_make_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/rsa/rsa_make_key.c b/src/pk/rsa/rsa_make_key.c index 23b98e0..065f733 100644 --- a/src/pk/rsa/rsa_make_key.c +++ b/src/pk/rsa/rsa_make_key.c @@ -97,7 +97,7 @@ int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) err = CRYPT_OK; goto cleanup; errkey: - mp_clear_multi(key->q, key->p, key->qP, key->dP, key->dQ, key->N, key->d, key->e, NULL); + rsa_free(key); cleanup: mp_clear_multi(tmp3, tmp2, tmp1, q, p, NULL); return err;