summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_srvr.c
diff options
context:
space:
mode:
authorjsing <>2014-05-28 13:03:25 +0000
committerjsing <>2014-05-28 13:03:25 +0000
commit1904ce01988b6ea0f5775507b4d812459c5b3f50 (patch)
tree60af46eb8cb0fcb0e51840739e416c98c124d73c /src/lib/libssl/s3_srvr.c
parent60cd1d60f58b32225afb881559d08dbc68a2eb79 (diff)
downloadopenbsd-1904ce01988b6ea0f5775507b4d812459c5b3f50.tar.gz
openbsd-1904ce01988b6ea0f5775507b4d812459c5b3f50.tar.bz2
openbsd-1904ce01988b6ea0f5775507b4d812459c5b3f50.zip
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@
Diffstat (limited to 'src/lib/libssl/s3_srvr.c')
-rw-r--r--src/lib/libssl/s3_srvr.c9
1 files changed, 3 insertions, 6 deletions
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:
1927 ssl3_send_alert(s, SSL3_AL_FATAL, al); 1927 ssl3_send_alert(s, SSL3_AL_FATAL, al);
1928err: 1928err:
1929#ifndef OPENSSL_NO_ECDH 1929#ifndef OPENSSL_NO_ECDH
1930 if (encodedPoint != NULL) 1930 free(encodedPoint);
1931 free(encodedPoint);
1932 BN_CTX_free(bn_ctx); 1931 BN_CTX_free(bn_ctx);
1933#endif 1932#endif
1934 EVP_MD_CTX_cleanup(&md_ctx); 1933 EVP_MD_CTX_cleanup(&md_ctx);
@@ -2435,8 +2434,7 @@ ssl3_get_client_key_exchange(SSL *s)
2435 t += psk_len; 2434 t += psk_len;
2436 s2n(psk_len, t); 2435 s2n(psk_len, t);
2437 2436
2438 if (s->session->psk_identity != NULL) 2437 free(s->session->psk_identity);
2439 free(s->session->psk_identity);
2440 s->session->psk_identity = BUF_strdup((char *)p); 2438 s->session->psk_identity = BUF_strdup((char *)p);
2441 if (s->session->psk_identity == NULL) { 2439 if (s->session->psk_identity == NULL) {
2442 SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, 2440 SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
@@ -2444,8 +2442,7 @@ ssl3_get_client_key_exchange(SSL *s)
2444 goto psk_err; 2442 goto psk_err;
2445 } 2443 }
2446 2444
2447 if (s->session->psk_identity_hint != NULL) 2445 free(s->session->psk_identity_hint);
2448 free(s->session->psk_identity_hint);
2449 s->session->psk_identity_hint = BUF_strdup(s->ctx->psk_identity_hint); 2446 s->session->psk_identity_hint = BUF_strdup(s->ctx->psk_identity_hint);
2450 if (s->ctx->psk_identity_hint != NULL && 2447 if (s->ctx->psk_identity_hint != NULL &&
2451 s->session->psk_identity_hint == NULL) { 2448 s->session->psk_identity_hint == NULL) {