summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec2_oct.c
diff options
context:
space:
mode:
authormiod <>2014-07-12 16:03:37 +0000
committermiod <>2014-07-12 16:03:37 +0000
commit1ae7466a2fdd60df6484d8d132d70a044fd58c92 (patch)
treeb756e0522f06b8c8ef257885370d0ada8f818fa8 /src/lib/libcrypto/ec/ec2_oct.c
parent3c4c98fca81949fb441815860d40ad66626df65d (diff)
downloadopenbsd-1ae7466a2fdd60df6484d8d132d70a044fd58c92.tar.gz
openbsd-1ae7466a2fdd60df6484d8d132d70a044fd58c92.tar.bz2
openbsd-1ae7466a2fdd60df6484d8d132d70a044fd58c92.zip
if (x) FOO_free(x) -> FOO_free(x).
Improves readability, keeps the code smaller so that it is warmer in your cache. review & ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/ec/ec2_oct.c')
-rw-r--r--src/lib/libcrypto/ec/ec2_oct.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lib/libcrypto/ec/ec2_oct.c b/src/lib/libcrypto/ec/ec2_oct.c
index 5150423b99..3b8039af6e 100644
--- a/src/lib/libcrypto/ec/ec2_oct.c
+++ b/src/lib/libcrypto/ec/ec2_oct.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec2_oct.c,v 1.4 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: ec2_oct.c,v 1.5 2014/07/12 16:03:37 miod Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -157,8 +157,7 @@ ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point
157 157
158err: 158err:
159 BN_CTX_end(ctx); 159 BN_CTX_end(ctx);
160 if (new_ctx != NULL) 160 BN_CTX_free(new_ctx);
161 BN_CTX_free(new_ctx);
162 return ret; 161 return ret;
163} 162}
164 163
@@ -267,15 +266,13 @@ ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point,
267 } 266 }
268 if (used_ctx) 267 if (used_ctx)
269 BN_CTX_end(ctx); 268 BN_CTX_end(ctx);
270 if (new_ctx != NULL) 269 BN_CTX_free(new_ctx);
271 BN_CTX_free(new_ctx);
272 return ret; 270 return ret;
273 271
274err: 272err:
275 if (used_ctx) 273 if (used_ctx)
276 BN_CTX_end(ctx); 274 BN_CTX_end(ctx);
277 if (new_ctx != NULL) 275 BN_CTX_free(new_ctx);
278 BN_CTX_free(new_ctx);
279 return 0; 276 return 0;
280} 277}
281 278
@@ -375,8 +372,7 @@ ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
375 372
376err: 373err:
377 BN_CTX_end(ctx); 374 BN_CTX_end(ctx);
378 if (new_ctx != NULL) 375 BN_CTX_free(new_ctx);
379 BN_CTX_free(new_ctx);
380 return ret; 376 return ret;
381} 377}
382#endif 378#endif