From f343af817aa3c5121ccee178feb8ac0fa700172b Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 7 Jun 2014 14:10:35 +0000 Subject: The DH_free, EC_KEY_free, EVP_PKEY_free and RSA_free functions all have implicit NULL checks, so there is no point ensuring that the pointer is non-NULL before calling them. --- src/lib/libssl/d1_clnt.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/lib/libssl/d1_clnt.c') diff --git a/src/lib/libssl/d1_clnt.c b/src/lib/libssl/d1_clnt.c index ef4a74e0af..8ff4d8e369 100644 --- a/src/lib/libssl/d1_clnt.c +++ b/src/lib/libssl/d1_clnt.c @@ -1211,8 +1211,7 @@ dtls1_send_client_key_exchange(SSL *s) /* Free allocated memory */ BN_CTX_free(bn_ctx); free(encodedPoint); - if (clnt_ecdh != NULL) - EC_KEY_free(clnt_ecdh); + EC_KEY_free(clnt_ecdh); EVP_PKEY_free(srvr_pub_pkey); } @@ -1321,11 +1320,11 @@ psk_err: /* SSL3_ST_CW_KEY_EXCH_B */ return (dtls1_do_write(s, SSL3_RT_HANDSHAKE)); + err: BN_CTX_free(bn_ctx); free(encodedPoint); - if (clnt_ecdh != NULL) - EC_KEY_free(clnt_ecdh); + EC_KEY_free(clnt_ecdh); EVP_PKEY_free(srvr_pub_pkey); return (-1); } @@ -1447,8 +1446,7 @@ dtls1_send_client_certificate(SSL *s) if (x509 != NULL) X509_free(x509); - if (pkey != NULL) - EVP_PKEY_free(pkey); + EVP_PKEY_free(pkey); if (i == 0) { if (s->version == SSL3_VERSION) { s->s3->tmp.cert_req = 0; -- cgit v1.2.3-55-g6feb