Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2015-04-22 22:08:19 +0300
committerAdam Langley <agl@google.com>2015-05-05 02:08:22 +0300
commitcfaf7ff9bf877239f17c805af6a3d7daae48e0a2 (patch)
tree873c4b8f54c1ba44b94e0c4ff13fd0d4ab516e5d /crypto/ec/ec.c
parent22ccc2d8f1e0a3d19b98324d502322db8d89624f (diff)
Remove unnecessary NULL checks, part 2.
Stuff in crypto/ec. Change-Id: I3bd238c365c4766ed8abc6f835a107478b43b159 Reviewed-on: https://boringssl-review.googlesource.com/4515 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/ec/ec.c')
-rw-r--r--crypto/ec/ec.c40
1 files changed, 10 insertions, 30 deletions
diff --git a/crypto/ec/ec.c b/crypto/ec/ec.c
index ab65ffb0..10220cbc 100644
--- a/crypto/ec/ec.c
+++ b/crypto/ec/ec.c
@@ -364,30 +364,14 @@ err:
EC_GROUP_free(group);
group = NULL;
}
- if (P) {
- EC_POINT_free(P);
- }
- if (ctx) {
- BN_CTX_free(ctx);
- }
- if (p) {
- BN_free(p);
- }
- if (a) {
- BN_free(a);
- }
- if (b) {
- BN_free(b);
- }
- if (order) {
- BN_free(order);
- }
- if (x) {
- BN_free(x);
- }
- if (y) {
- BN_free(y);
- }
+ EC_POINT_free(P);
+ BN_CTX_free(ctx);
+ BN_free(p);
+ BN_free(a);
+ BN_free(b);
+ BN_free(order);
+ BN_free(x);
+ BN_free(y);
return group;
}
@@ -424,9 +408,7 @@ void EC_GROUP_free(EC_GROUP *group) {
ec_pre_comp_free(group->pre_comp);
- if (group->generator != NULL) {
- EC_POINT_free(group->generator);
- }
+ EC_POINT_free(group->generator);
BN_free(&group->order);
BN_free(&group->cofactor);
@@ -497,9 +479,7 @@ EC_GROUP *EC_GROUP_dup(const EC_GROUP *a) {
err:
if (!ok) {
- if (t) {
- EC_GROUP_free(t);
- }
+ EC_GROUP_free(t);
return NULL;
} else {
return t;