summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bn/bn_rand.c')
-rw-r--r--crypto/bn/bn_rand.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c
index fd17e7a601..46ace0744d 100644
--- a/crypto/bn/bn_rand.c
+++ b/crypto/bn/bn_rand.c
@@ -41,10 +41,8 @@ static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom,
mask = 0xff << (bit + 1);
buf = OPENSSL_malloc(bytes);
- if (buf == NULL) {
- ERR_raise(ERR_LIB_BN, ERR_R_MALLOC_FAILURE);
+ if (buf == NULL)
goto err;
- }
/* make a random number and set the top and bottom bits */
b = flag == NORMAL ? RAND_bytes_ex(libctx, buf, bytes, strength)