diff options
author | 2017-01-24 14:57:31 +0000 | |
---|---|---|
committer | 2017-01-24 14:57:31 +0000 | |
commit | 2da53ce5a262494b116213d78f7f70f77a590551 (patch) | |
tree | 08a54d1f04c49d31954fb8d623d2a1a9c1ebad0f /lib/libssl/s3_lib.c | |
parent | Kill some unused variables found by clang. (diff) | |
download | wireguard-openbsd-2da53ce5a262494b116213d78f7f70f77a590551.tar.xz wireguard-openbsd-2da53ce5a262494b116213d78f7f70f77a590551.zip |
sk_pop_free() checks for NULL so do not bother doing it from the callers.
Diffstat (limited to 'lib/libssl/s3_lib.c')
-rw-r--r-- | lib/libssl/s3_lib.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/libssl/s3_lib.c b/lib/libssl/s3_lib.c index 9d0217e95f4..977c170403b 100644 --- a/lib/libssl/s3_lib.c +++ b/lib/libssl/s3_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_lib.c,v 1.130 2017/01/24 09:03:21 jsing Exp $ */ +/* $OpenBSD: s3_lib.c,v 1.131 2017/01/24 14:57:31 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1838,8 +1838,7 @@ ssl3_free(SSL *s) explicit_bzero(S3I(s)->tmp.x25519, X25519_KEY_LENGTH); free(S3I(s)->tmp.x25519); - if (S3I(s)->tmp.ca_names != NULL) - sk_X509_NAME_pop_free(S3I(s)->tmp.ca_names, X509_NAME_free); + sk_X509_NAME_pop_free(S3I(s)->tmp.ca_names, X509_NAME_free); BIO_free(S3I(s)->handshake_buffer); tls1_free_digest_list(s); free(S3I(s)->alpn_selected); @@ -1861,8 +1860,7 @@ ssl3_clear(SSL *s) size_t rlen, wlen; tls1_cleanup_key_block(s); - if (S3I(s)->tmp.ca_names != NULL) - sk_X509_NAME_pop_free(S3I(s)->tmp.ca_names, X509_NAME_free); + sk_X509_NAME_pop_free(S3I(s)->tmp.ca_names, X509_NAME_free); DH_free(S3I(s)->tmp.dh); S3I(s)->tmp.dh = NULL; @@ -2330,10 +2328,8 @@ ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) break; case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS: - if (ctx->extra_certs) { - sk_X509_pop_free(ctx->extra_certs, X509_free); - ctx->extra_certs = NULL; - } + sk_X509_pop_free(ctx->extra_certs, X509_free); + ctx->extra_certs = NULL; break; default: |