summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_blind.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-30 21:37:06 -0400
committerRich Salz <rsalz@openssl.org>2015-04-30 21:37:06 -0400
commit23a1d5e97cd543d2b8e1b01dbf0f619b2e5ce540 (patch)
tree2d9372864fc2b34939d21b3706768ec225c9548f /crypto/bn/bn_blind.c
parent34166d41892643a36ad2d1f53cc0025e2edc2a39 (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/bn/bn_blind.c')
-rw-r--r--crypto/bn/bn_blind.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/crypto/bn/bn_blind.c b/crypto/bn/bn_blind.c
index f045904f76..659638bc45 100644
--- a/crypto/bn/bn_blind.c
+++ b/crypto/bn/bn_blind.c
@@ -166,8 +166,7 @@ BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)
CRYPTO_THREADID_current(&ret->tid);
return (ret);
err:
- if (ret != NULL)
- BN_BLINDING_free(ret);
+ BN_BLINDING_free(ret);
return (NULL);
}
@@ -176,14 +175,10 @@ void BN_BLINDING_free(BN_BLINDING *r)
if (r == NULL)
return;
- if (r->A != NULL)
- BN_free(r->A);
- if (r->Ai != NULL)
- BN_free(r->Ai);
- if (r->e != NULL)
- BN_free(r->e);
- if (r->mod != NULL)
- BN_free(r->mod);
+ BN_free(r->A);
+ BN_free(r->Ai);
+ BN_free(r->e);
+ BN_free(r->mod);
OPENSSL_free(r);
}
@@ -331,8 +326,7 @@ BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
goto err;
if (e != NULL) {
- if (ret->e != NULL)
- BN_free(ret->e);
+ BN_free(ret->e);
ret->e = BN_dup(e);
}
if (ret->e == NULL)
@@ -374,7 +368,7 @@ BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
return ret;
err:
- if (b == NULL && ret != NULL) {
+ if (b == NULL) {
BN_BLINDING_free(ret);
ret = NULL;
}