From e0fe7abeec00d6e7624c186150189c56f10a5818 Mon Sep 17 00:00:00 2001 From: Nils Larsch Date: Tue, 14 Mar 2006 09:07:06 +0000 Subject: [PATCH] apply fixes from the cvs head --- crypto/dh/dh_key.c | 7 +++++-- crypto/rsa/rsa_gen.c | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c index 071b43f843..3a39f7c8ca 100644 --- a/crypto/dh/dh_key.c +++ b/crypto/dh/dh_key.c @@ -213,8 +213,11 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) ret=BN_bn2bin(tmp,key); err: - BN_CTX_end(ctx); - BN_CTX_free(ctx); + if (ctx != NULL) + { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } return(ret); } diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c index adb5e34da5..dd1422cc98 100644 --- a/crypto/rsa/rsa_gen.c +++ b/crypto/rsa/rsa_gen.c @@ -184,7 +184,8 @@ err: RSAerr(RSA_F_RSA_GENERATE_KEY,ERR_LIB_BN); ok=0; } - BN_CTX_end(ctx); + if (ctx != NULL) + BN_CTX_end(ctx); BN_CTX_free(ctx); BN_CTX_free(ctx2); -- 2.25.1