From 1ae7466a2fdd60df6484d8d132d70a044fd58c92 Mon Sep 17 00:00:00 2001 From: miod <> Date: Sat, 12 Jul 2014 16:03:37 +0000 Subject: 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@ --- src/lib/libcrypto/ec/ecp_oct.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/lib/libcrypto/ec/ecp_oct.c') diff --git a/src/lib/libcrypto/ec/ecp_oct.c b/src/lib/libcrypto/ec/ecp_oct.c index 2f2920d70d..d2402ee0d8 100644 --- a/src/lib/libcrypto/ec/ecp_oct.c +++ b/src/lib/libcrypto/ec/ecp_oct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_oct.c,v 1.4 2014/06/12 15:49:29 deraadt Exp $ */ +/* $OpenBSD: ecp_oct.c,v 1.5 2014/07/12 16:03:37 miod Exp $ */ /* Includes code written by Lenka Fibikova * for the OpenSSL project. * Includes code written by Bodo Moeller for the OpenSSL project. @@ -190,8 +190,7 @@ ec_GFp_simple_set_compressed_coordinates(const EC_GROUP * group, EC_POINT * poin err: BN_CTX_end(ctx); - if (new_ctx != NULL) - BN_CTX_free(new_ctx); + BN_CTX_free(new_ctx); return ret; } @@ -290,15 +289,13 @@ ec_GFp_simple_point2oct(const EC_GROUP * group, const EC_POINT * point, point_co } if (used_ctx) BN_CTX_end(ctx); - if (new_ctx != NULL) - BN_CTX_free(new_ctx); + BN_CTX_free(new_ctx); return ret; err: if (used_ctx) BN_CTX_end(ctx); - if (new_ctx != NULL) - BN_CTX_free(new_ctx); + BN_CTX_free(new_ctx); return 0; } @@ -391,7 +388,6 @@ ec_GFp_simple_oct2point(const EC_GROUP * group, EC_POINT * point, err: BN_CTX_end(ctx); - if (new_ctx != NULL) - BN_CTX_free(new_ctx); + BN_CTX_free(new_ctx); return ret; } -- cgit v1.2.3-55-g6feb