summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2017-01-24 14:57:31 +0000
committerjsing <jsing@openbsd.org>2017-01-24 14:57:31 +0000
commit2da53ce5a262494b116213d78f7f70f77a590551 (patch)
tree08a54d1f04c49d31954fb8d623d2a1a9c1ebad0f /lib/libssl/ssl_lib.c
parentKill some unused variables found by clang. (diff)
downloadwireguard-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/ssl_lib.c')
-rw-r--r--lib/libssl/ssl_lib.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index 21d2d231d10..bdf6bc6ee38 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.146 2017/01/24 13:34:26 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.147 2017/01/24 14:57:31 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -561,17 +561,16 @@ SSL_free(SSL *s)
free(s->tlsext_hostname);
SSL_CTX_free(s->initial_ctx);
+
free(s->internal->tlsext_ecpointformatlist);
free(s->internal->tlsext_supportedgroups);
- if (s->internal->tlsext_ocsp_exts)
- sk_X509_EXTENSION_pop_free(s->internal->tlsext_ocsp_exts,
- X509_EXTENSION_free);
- if (s->internal->tlsext_ocsp_ids)
- sk_OCSP_RESPID_pop_free(s->internal->tlsext_ocsp_ids, OCSP_RESPID_free);
+
+ sk_X509_EXTENSION_pop_free(s->internal->tlsext_ocsp_exts,
+ X509_EXTENSION_free);
+ sk_OCSP_RESPID_pop_free(s->internal->tlsext_ocsp_ids, OCSP_RESPID_free);
free(s->internal->tlsext_ocsp_resp);
- if (s->internal->client_CA != NULL)
- sk_X509_NAME_pop_free(s->internal->client_CA, X509_NAME_free);
+ sk_X509_NAME_pop_free(s->internal->client_CA, X509_NAME_free);
if (s->method != NULL)
s->method->internal->ssl_free(s);
@@ -2011,10 +2010,8 @@ SSL_CTX_free(SSL_CTX *ctx)
sk_SSL_CIPHER_free(ctx->cipher_list);
sk_SSL_CIPHER_free(ctx->internal->cipher_list_by_id);
ssl_cert_free(ctx->internal->cert);
- if (ctx->internal->client_CA != NULL)
- sk_X509_NAME_pop_free(ctx->internal->client_CA, X509_NAME_free);
- if (ctx->extra_certs != NULL)
- sk_X509_pop_free(ctx->extra_certs, X509_free);
+ sk_X509_NAME_pop_free(ctx->internal->client_CA, X509_NAME_free);
+ sk_X509_pop_free(ctx->extra_certs, X509_free);
#ifndef OPENSSL_NO_SRTP
if (ctx->internal->srtp_profiles)