aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bn
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>1999-01-07 19:15:59 +0000
committerBen Laurie <ben@openssl.org>1999-01-07 19:15:59 +0000
commite03ddfae7ea7c27193d3f7c0eaa1d01704647d77 (patch)
tree7cf2e8444b222a3a52c4735e0415916bb81c4494 /crypto/bn
parent6fa89f94c4452be54577eb071891d77c9e2abe16 (diff)
downloadopenssl-e03ddfae7ea7c27193d3f7c0eaa1d01704647d77.tar.gz
Accept NULL in *_free.
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn_blind.c3
-rw-r--r--crypto/bn/bn_lib.c3
-rw-r--r--crypto/bn/bn_mont.c3
-rw-r--r--crypto/bn/bn_recp.c3
4 files changed, 12 insertions, 0 deletions
diff --git a/crypto/bn/bn_blind.c b/crypto/bn/bn_blind.c
index 35be32b99a..c247f71c8a 100644
--- a/crypto/bn/bn_blind.c
+++ b/crypto/bn/bn_blind.c
@@ -90,6 +90,9 @@ err:
void BN_BLINDING_free(r)
BN_BLINDING *r;
{
+ if(r == NULL)
+ return;
+
if (r->A != NULL) BN_free(r->A );
if (r->Ai != NULL) BN_free(r->Ai);
Free(r);
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index c027d0b03e..d8d2c3297d 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -341,6 +341,9 @@ BN_CTX *c;
{
int i;
+ if(c == NULL)
+ return;
+
for (i=0; i<BN_CTX_NUM; i++)
BN_clear_free(&(c->bn[i]));
if (c->flags & BN_FLG_MALLOCED)
diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c
index a5640b5a3b..2215dc3589 100644
--- a/crypto/bn/bn_mont.c
+++ b/crypto/bn/bn_mont.c
@@ -289,6 +289,9 @@ BN_MONT_CTX *ctx;
void BN_MONT_CTX_free(mont)
BN_MONT_CTX *mont;
{
+ if(mont == NULL)
+ return;
+
BN_free(&(mont->RR));
BN_free(&(mont->N));
BN_free(&(mont->Ni));
diff --git a/crypto/bn/bn_recp.c b/crypto/bn/bn_recp.c
index 97ca857ed1..3ace566b55 100644
--- a/crypto/bn/bn_recp.c
+++ b/crypto/bn/bn_recp.c
@@ -84,6 +84,9 @@ BN_RECP_CTX *BN_RECP_CTX_new()
void BN_RECP_CTX_free(recp)
BN_RECP_CTX *recp;
{
+ if(recp == NULL)
+ return;
+
BN_free(&(recp->N));
BN_free(&(recp->Nr));
if (recp->flags & BN_FLG_MALLOCED)