summaryrefslogtreecommitdiff
path: root/crypto/bn/bn_depr.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_depr.c
parent34166d41892643a36ad2d1f53cc0025e2edc2a39 (diff)
downloadopenssl-new-23a1d5e97cd543d2b8e1b01dbf0f619b2e5ce540.tar.gz
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_depr.c')
-rw-r--r--crypto/bn/bn_depr.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/crypto/bn/bn_depr.c b/crypto/bn/bn_depr.c
index 34895f5982..bc15f8317e 100644
--- a/crypto/bn/bn_depr.c
+++ b/crypto/bn/bn_depr.c
@@ -73,7 +73,6 @@ BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
{
BN_GENCB cb;
BIGNUM *rnd = NULL;
- int found = 0;
BN_GENCB_set_old(&cb, callback, cb_arg);
@@ -86,11 +85,10 @@ BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
goto err;
/* we have a prime :-) */
- found = 1;
+ return ret;
err:
- if (!found && (ret == NULL) && (rnd != NULL))
- BN_free(rnd);
- return (found ? rnd : NULL);
+ BN_free(rnd);
+ return NULL;
}
int BN_is_prime(const BIGNUM *a, int checks,