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/ssl_cert.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/ssl_cert.c')
-rw-r--r-- | lib/libssl/ssl_cert.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/libssl/ssl_cert.c b/lib/libssl/ssl_cert.c index c23e789bf8f..9ce8585d46f 100644 --- a/lib/libssl/ssl_cert.c +++ b/lib/libssl/ssl_cert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_cert.c,v 1.58 2017/01/23 06:45:30 beck Exp $ */ +/* $OpenBSD: ssl_cert.c,v 1.59 2017/01/24 14:57:31 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -395,9 +395,7 @@ ssl_sess_cert_free(SESS_CERT *sc) if (i > 0) return; - /* i == 0 */ - if (sc->cert_chain != NULL) - sk_X509_pop_free(sc->cert_chain, X509_free); + sk_X509_pop_free(sc->cert_chain, X509_free); for (i = 0; i < SSL_PKEY_NUM; i++) X509_free(sc->peer_pkeys[i].x509); @@ -459,9 +457,7 @@ static void set_client_CA_list(STACK_OF(X509_NAME) **ca_list, STACK_OF(X509_NAME) *name_list) { - if (*ca_list != NULL) - sk_X509_NAME_pop_free(*ca_list, X509_NAME_free); - + sk_X509_NAME_pop_free(*ca_list, X509_NAME_free); *ca_list = name_list; } @@ -611,8 +607,7 @@ SSL_load_client_CA_file(const char *file) if (0) { err: - if (ret != NULL) - sk_X509_NAME_pop_free(ret, X509_NAME_free); + sk_X509_NAME_pop_free(ret, X509_NAME_free); ret = NULL; } if (sk != NULL) |