use rsa_free() on error in rsa_make_key()

This commit is contained in:
Steffen Jaeckel 2017-07-09 16:02:11 +02:00
parent 749873c306
commit 68bf547f9c

View File

@ -97,7 +97,7 @@ int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key)
err = CRYPT_OK; err = CRYPT_OK;
goto cleanup; goto cleanup;
errkey: 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: cleanup:
mp_clear_multi(tmp3, tmp2, tmp1, q, p, NULL); mp_clear_multi(tmp3, tmp2, tmp1, q, p, NULL);
return err; return err;