diff options
author | Matt Caswell <matt@openssl.org> | 2016-08-23 00:34:30 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-08-23 01:19:15 +0200 |
commit | 4d94bd362dc297c8496a479d1059ec3192fd8bbe (patch) | |
tree | d57a98038402933c3532a03d134d111e8a7a0b77 /crypto/bn/bn_x931p.c | |
parent | Fix mem leak on error path (diff) | |
download | openssl-4d94bd362dc297c8496a479d1059ec3192fd8bbe.tar.xz openssl-4d94bd362dc297c8496a479d1059ec3192fd8bbe.zip |
Check for malloc error in bn_x931p.c
Ensure BN_CTX_get() has been successful
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/bn/bn_x931p.c')
-rw-r--r-- | crypto/bn/bn_x931p.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/bn/bn_x931p.c b/crypto/bn/bn_x931p.c index 516ad34ca7..40734cb2f6 100644 --- a/crypto/bn/bn_x931p.c +++ b/crypto/bn/bn_x931p.c @@ -74,6 +74,9 @@ int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, pm1 = BN_CTX_get(ctx); + if (pm1 == NULL) + goto err; + if (!bn_x931_derive_pi(p1, Xp1, ctx, cb)) goto err; |