apply fixes from the cvs head
authorNils Larsch <nils@openssl.org>
Tue, 14 Mar 2006 09:07:06 +0000 (09:07 +0000)
committerNils Larsch <nils@openssl.org>
Tue, 14 Mar 2006 09:07:06 +0000 (09:07 +0000)
crypto/dh/dh_key.c
crypto/rsa/rsa_gen.c

index 071b43f8436d210a6da174295f48e14ab8c81c58..3a39f7c8cae2d13afb16e2e5e2bcdbd9ed3155d6 100644 (file)
@@ -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);
        }
 
index adb5e34da56c7de7a64e25a6335b44e84aaebab2..dd1422cc98bb408b7cee5f717e9fe7d89b281649 100644 (file)
@@ -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);