summaryrefslogtreecommitdiff
path: root/lib/libcrypto/ec/ec_lib.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-05-30 02:52:12 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-05-30 02:52:12 +0000
commit890019d42bea9ea72b2a114957766c9c1b3cb7e3 (patch)
treedb57e71a5688e5229112337dcc33ca76da88d600 /lib/libcrypto/ec/ec_lib.c
parent8e9c3c8ab205533cebb588280a86d9ff2ec73fa2 (diff)
no need for null check before free. from Brendan MacDonell
Diffstat (limited to 'lib/libcrypto/ec/ec_lib.c')
-rw-r--r--lib/libcrypto/ec/ec_lib.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libcrypto/ec/ec_lib.c b/lib/libcrypto/ec/ec_lib.c
index b37efac246a..3313573a05c 100644
--- a/lib/libcrypto/ec/ec_lib.c
+++ b/lib/libcrypto/ec/ec_lib.c
@@ -130,8 +130,7 @@ EC_GROUP_free(EC_GROUP * group)
BN_free(&group->order);
BN_free(&group->cofactor);
- if (group->seed)
- free(group->seed);
+ free(group->seed);
free(group);
}
@@ -218,8 +217,7 @@ EC_GROUP_copy(EC_GROUP * dest, const EC_GROUP * src)
dest->asn1_form = src->asn1_form;
if (src->seed) {
- if (dest->seed)
- free(dest->seed);
+ free(dest->seed);
dest->seed = malloc(src->seed_len);
if (dest->seed == NULL)
return 0;
@@ -227,8 +225,7 @@ EC_GROUP_copy(EC_GROUP * dest, const EC_GROUP * src)
return 0;
dest->seed_len = src->seed_len;
} else {
- if (dest->seed)
- free(dest->seed);
+ free(dest->seed);
dest->seed = NULL;
dest->seed_len = 0;
}