summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_lib.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2002-05-21 10:59:57 +0200
committerBodo Möller <bodo@openssl.org>2002-05-21 10:59:57 +0200
commit7711de24f914e4d283766acec0973daad30b5936 (patch)
tree3e544fc154bc7e4a9ccc33c1ccc0624aa427a532 /crypto/ec/ec_lib.c
parentReorganise -subj option code, fix buffer overrun. (diff)
downloadopenssl-7711de24f914e4d283766acec0973daad30b5936.tar.xz
openssl-7711de24f914e4d283766acec0973daad30b5936.zip
accept NULL in 'free' functions
Diffstat (limited to 'crypto/ec/ec_lib.c')
-rw-r--r--crypto/ec/ec_lib.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c
index 0597087cb7..f469b679d8 100644
--- a/crypto/ec/ec_lib.c
+++ b/crypto/ec/ec_lib.c
@@ -112,6 +112,8 @@ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
void EC_GROUP_free(EC_GROUP *group)
{
+ if (!group) return;
+
if (group->meth->group_finish != 0)
group->meth->group_finish(group);
@@ -128,6 +130,8 @@ void EC_GROUP_free(EC_GROUP *group)
void EC_GROUP_clear_free(EC_GROUP *group)
{
+ if (!group) return;
+
if (group->meth->group_clear_finish != 0)
group->meth->group_clear_finish(group);
else if (group->meth != NULL && group->meth->group_finish != 0)
@@ -408,6 +412,8 @@ EC_POINT *EC_POINT_new(const EC_GROUP *group)
void EC_POINT_free(EC_POINT *point)
{
+ if (!point) return;
+
if (point->meth->point_finish != 0)
point->meth->point_finish(point);
OPENSSL_free(point);
@@ -416,6 +422,8 @@ void EC_POINT_free(EC_POINT *point)
void EC_POINT_clear_free(EC_POINT *point)
{
+ if (!point) return;
+
if (point->meth->point_clear_finish != 0)
point->meth->point_clear_finish(point);
else if (point->meth != NULL && point->meth->point_finish != 0)