use clear_multi, don't call init twice

This commit is contained in:
Love Hornquist Astrand
2010-10-27 22:19:22 -07:00
parent 6d47c862ec
commit bbe08b7750

View File

@@ -119,9 +119,7 @@ ltm_dh_generate_key(DH *dh)
res = mp_exptmod(&g, &priv_key, &p, &pub);
mp_clear(&priv_key);
mp_clear(&g);
mp_clear(&p);
mp_clear_multi(&priv_key, &g, &p, NULL);
if (res != 0)
continue;
@@ -175,8 +173,6 @@ ltm_dh_compute_key(unsigned char *shared, const BIGNUM * pub, DH *dh)
BN2mpz(&priv_key, dh->priv_key);
mp_init(&s);
ret = mp_exptmod(&peer_pub, &priv_key, &p, &s);
if (ret != 0) {