Browse Source

use rsa_free() on error in rsa_make_key()

Steffen Jaeckel 8 years ago
parent
commit
68bf547f9c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/pk/rsa/rsa_make_key.c

+ 1 - 1
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;
    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;