summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/dh/dh_lib.c
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-07-12 16:03:36 +0000
committermiod <miod@openbsd.org>2014-07-12 16:03:36 +0000
commit6d04a7b1e8407e9617237f4260725ef336c500fb (patch)
treebbc0f98986ce22a51cebd8697a6f8887f19e0d6f /lib/libcrypto/dh/dh_lib.c
parentAdd an initial regress test for libressl, which calls ressl from Go and (diff)
downloadwireguard-openbsd-6d04a7b1e8407e9617237f4260725ef336c500fb.tar.xz
wireguard-openbsd-6d04a7b1e8407e9617237f4260725ef336c500fb.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 'lib/libcrypto/dh/dh_lib.c')
-rw-r--r--lib/libcrypto/dh/dh_lib.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/lib/libcrypto/dh/dh_lib.c b/lib/libcrypto/dh/dh_lib.c
index 0a956e5416f..c438f387c01 100644
--- a/lib/libcrypto/dh/dh_lib.c
+++ b/lib/libcrypto/dh/dh_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh_lib.c,v 1.19 2014/07/11 08:44:48 jsing Exp $ */
+/* $OpenBSD: dh_lib.c,v 1.20 2014/07/12 16:03:37 miod Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -194,21 +194,14 @@ DH_free(DH *r)
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);
- if (r->p != NULL)
- BN_clear_free(r->p);
- if (r->g != NULL)
- BN_clear_free(r->g);
- if (r->q != NULL)
- BN_clear_free(r->q);
- if (r->j != NULL)
- BN_clear_free(r->j);
+ BN_clear_free(r->p);
+ BN_clear_free(r->g);
+ BN_clear_free(r->q);
+ BN_clear_free(r->j);
free(r->seed);
- if (r->counter != NULL)
- BN_clear_free(r->counter);
- if (r->pub_key != NULL)
- BN_clear_free(r->pub_key);
- if (r->priv_key != NULL)
- BN_clear_free(r->priv_key);
+ BN_clear_free(r->counter);
+ BN_clear_free(r->pub_key);
+ BN_clear_free(r->priv_key);
free(r);
}