aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>1999-01-04 21:39:34 +0000
committerBen Laurie <ben@openssl.org>1999-01-04 21:39:34 +0000
commit4a18cddd168bec6a4e22ecf733149efa4d85b3a5 (patch)
treed45133ff4d69406d27df1d3dedea524b76293785
parentbb65e20b1cc12f928a2e22765a00d938d1a12ced (diff)
downloadopenssl-4a18cddd168bec6a4e22ecf733149efa4d85b3a5.tar.gz
Only free if it ain't NULL.
-rw-r--r--CHANGES3
-rw-r--r--crypto/rsa/rsa_eay.c3
-rw-r--r--crypto/rsa/rsa_enc.c3
3 files changed, 7 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 36064507e8..b2e31d6cf4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,9 @@
Changes between 0.9.1c and 0.9.2
+ *) rsa_eay.c would attempt to free a NULL context.
+ [Arne Ansper <arne@ats.cyber.ee>]
+
*) BIO_s_socket() had a broken should_retry() on Windoze.
[Arne Ansper <arne@ats.cyber.ee>]
diff --git a/crypto/rsa/rsa_eay.c b/crypto/rsa/rsa_eay.c
index b4050506c3..ec143e873b 100644
--- a/crypto/rsa/rsa_eay.c
+++ b/crypto/rsa/rsa_eay.c
@@ -474,7 +474,8 @@ RSA *rsa;
err:
BN_clear_free(&m1);
BN_clear_free(&r1);
- BN_CTX_free(ctx);
+ if(ctx)
+ BN_CTX_free(ctx);
return(ret);
}
diff --git a/crypto/rsa/rsa_enc.c b/crypto/rsa/rsa_enc.c
index c4a4ad5a60..5f91239da5 100644
--- a/crypto/rsa/rsa_enc.c
+++ b/crypto/rsa/rsa_enc.c
@@ -531,7 +531,8 @@ RSA *rsa;
err:
if (m1 != NULL) BN_free(m1);
if (r1 != NULL) BN_free(r1);
- BN_CTX_free(ctx);
+ if(ctx != NULL)
+ BN_CTX_free(ctx);
return(ret);
}