summaryrefslogtreecommitdiffstats
path: root/kex.c
diff options
context:
space:
mode:
authorjsing@openbsd.org <jsing@openbsd.org>2018-02-07 02:06:50 +0000
committerDarren Tucker <dtucker@dtucker.net>2018-02-08 09:26:27 +1100
commit7cd31632e3a6607170ed0c9ed413a7ded5b9b377 (patch)
tree2acf74a8e668468768bdf9fe1b48d2289b3299bb /kex.c
parent3c000d57d46882eb736c6563edfc4995915c24a2 (diff)
upstream commit
Remove all guards for calls to OpenSSL free functions - all of these functions handle NULL, from at least OpenSSL 1.0.1g onwards. Prompted by dtucker@ asking about guards for RSA_free(), when looking at openssh-portable pr#84 on github. ok deraadt@ dtucker@ OpenBSD-Commit-ID: 954f1c51b94297d0ae1f749271e184141e0cadae
Diffstat (limited to 'kex.c')
-rw-r--r--kex.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/kex.c b/kex.c
index 83c6199f..15ea28b0 100644
--- a/kex.c
+++ b/kex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.135 2018/01/23 05:27:21 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.136 2018/02/07 02:06:50 jsing Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -587,11 +587,9 @@ kex_free(struct kex *kex)
u_int mode;
#ifdef WITH_OPENSSL
- if (kex->dh)
- DH_free(kex->dh);
+ DH_free(kex->dh);
#ifdef OPENSSL_HAS_ECC
- if (kex->ec_client_key)
- EC_KEY_free(kex->ec_client_key);
+ EC_KEY_free(kex->ec_client_key);
#endif /* OPENSSL_HAS_ECC */
#endif /* WITH_OPENSSL */
for (mode = 0; mode < MODE_MAX; mode++) {