From 1904ce01988b6ea0f5775507b4d812459c5b3f50 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 28 May 2014 13:03:25 +0000 Subject: There is no point in checking if a pointer is non-NULL before calling free, since free already does this for us. Also remove some pointless NULL assignments, where the result from malloc(3) is immediately assigned to the same variable. ok miod@ --- src/lib/libssl/s3_srvr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/lib/libssl/s3_srvr.c') diff --git a/src/lib/libssl/s3_srvr.c b/src/lib/libssl/s3_srvr.c index 521f6a21e8..c16f7bb2ef 100644 --- a/src/lib/libssl/s3_srvr.c +++ b/src/lib/libssl/s3_srvr.c @@ -1927,8 +1927,7 @@ f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); err: #ifndef OPENSSL_NO_ECDH - if (encodedPoint != NULL) - free(encodedPoint); + free(encodedPoint); BN_CTX_free(bn_ctx); #endif EVP_MD_CTX_cleanup(&md_ctx); @@ -2435,8 +2434,7 @@ ssl3_get_client_key_exchange(SSL *s) t += psk_len; s2n(psk_len, t); - if (s->session->psk_identity != NULL) - free(s->session->psk_identity); + free(s->session->psk_identity); s->session->psk_identity = BUF_strdup((char *)p); if (s->session->psk_identity == NULL) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, @@ -2444,8 +2442,7 @@ ssl3_get_client_key_exchange(SSL *s) goto psk_err; } - if (s->session->psk_identity_hint != NULL) - free(s->session->psk_identity_hint); + free(s->session->psk_identity_hint); s->session->psk_identity_hint = BUF_strdup(s->ctx->psk_identity_hint); if (s->ctx->psk_identity_hint != NULL && s->session->psk_identity_hint == NULL) { -- cgit v1.2.3-55-g6feb