diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-30 21:37:06 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-30 21:37:06 -0400 |
commit | 23a1d5e97cd543d2b8e1b01dbf0f619b2e5ce540 (patch) | |
tree | 2d9372864fc2b34939d21b3706768ec225c9548f /crypto/dh/dh_pmeth.c | |
parent | 34166d41892643a36ad2d1f53cc0025e2edc2a39 (diff) |
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>
Diffstat (limited to 'crypto/dh/dh_pmeth.c')
-rw-r--r-- | crypto/dh/dh_pmeth.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/dh/dh_pmeth.c b/crypto/dh/dh_pmeth.c index e3ebc0201d..069b855aa0 100644 --- a/crypto/dh/dh_pmeth.c +++ b/crypto/dh/dh_pmeth.c @@ -383,8 +383,7 @@ static int pkey_dh_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) if (dctx->use_dsa) { DSA *dsa_dh; dsa_dh = dsa_dh_generate(dctx, pcb); - if (pcb) - BN_GENCB_free(pcb); + BN_GENCB_free(pcb); if (!dsa_dh) return 0; dh = DSA_dup_DH(dsa_dh); @@ -397,14 +396,12 @@ static int pkey_dh_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) #endif dh = DH_new(); if (!dh) { - if (pcb) - BN_GENCB_free(pcb); + BN_GENCB_free(pcb); return 0; } ret = DH_generate_parameters_ex(dh, dctx->prime_len, dctx->generator, pcb); - if (pcb) - BN_GENCB_free(pcb); + BN_GENCB_free(pcb); if (ret) EVP_PKEY_assign_DH(pkey, dh); else |