From: Nils Larsch Date: Tue, 14 Mar 2006 09:07:06 +0000 (+0000) Subject: apply fixes from the cvs head X-Git-Tag: OpenSSL_0_9_7j~12 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e0fe7abeec00d6e7624c186150189c56f10a5818;p=oweals%2Fopenssl.git apply fixes from the cvs head --- 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);