free NULL cleanup 7

This gets BN_.*free:
    BN_BLINDING_free BN_CTX_free BN_FLG_FREE BN_GENCB_free
    BN_MONT_CTX_free BN_RECP_CTX_free BN_clear_free BN_free BUF_MEM_free

Also fix a call to DSA_SIG_free to ccgost engine and remove some #ifdef'd
dead code in engines/e_ubsec.

Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Rich Salz
2015-04-30 21:37:06 -04:00
parent 34166d4189
commit 23a1d5e97c
80 changed files with 384 additions and 733 deletions

View File

@@ -241,8 +241,7 @@ static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity,
if (!ret) {
BIO_printf(bio_err, "Could not convert PSK key '%s' to BIGNUM\n",
psk_key);
if (bn)
BN_free(bn);
BN_free(bn);
return 0;
}
@@ -320,12 +319,9 @@ static int srp_Verify_N_and_g(const BIGNUM *N, const BIGNUM *g)
BN_mod_exp(r, g, p, N, bn_ctx) &&
BN_add_word(r, 1) && BN_cmp(r, N) == 0;
if (r)
BN_free(r);
if (p)
BN_free(p);
if (bn_ctx)
BN_CTX_free(bn_ctx);
BN_free(r);
BN_free(p);
BN_CTX_free(bn_ctx);
return ret;
}