From 71e6acb0d65f7db5b5d23d22c0a5eaf2fd76d0c4 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Tue, 24 Jan 2017 01:39:13 +0000 Subject: ssl_sess_cert_free() checks for NULL, so do not bother doing it at the call sites. --- src/lib/libssl/s3_clnt.c | 5 ++--- src/lib/libssl/ssl_sess.c | 9 ++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libssl/s3_clnt.c b/src/lib/libssl/s3_clnt.c index 055f8d1f3a..e8cc0e3905 100644 --- a/src/lib/libssl/s3_clnt.c +++ b/src/lib/libssl/s3_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_clnt.c,v 1.170 2017/01/23 13:36:13 jsing Exp $ */ +/* $OpenBSD: s3_clnt.c,v 1.171 2017/01/24 01:39:13 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1037,8 +1037,7 @@ ssl3_get_server_certificate(SSL *s) sc = ssl_sess_cert_new(); if (sc == NULL) goto err; - if (SSI(s)->sess_cert) - ssl_sess_cert_free(SSI(s)->sess_cert); + ssl_sess_cert_free(SSI(s)->sess_cert); SSI(s)->sess_cert = sc; sc->cert_chain = sk; diff --git a/src/lib/libssl/ssl_sess.c b/src/lib/libssl/ssl_sess.c index 4033b1e8f1..2ebdf81b41 100644 --- a/src/lib/libssl/ssl_sess.c +++ b/src/lib/libssl/ssl_sess.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_sess.c,v 1.64 2017/01/24 01:34:09 jsing Exp $ */ +/* $OpenBSD: ssl_sess.c,v 1.65 2017/01/24 01:39:13 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -699,11 +699,14 @@ SSL_SESSION_free(SSL_SESSION *ss) explicit_bzero(ss->master_key, sizeof ss->master_key); explicit_bzero(ss->session_id, sizeof ss->session_id); - if (ss->internal->sess_cert != NULL) - ssl_sess_cert_free(ss->internal->sess_cert); + + ssl_sess_cert_free(ss->internal->sess_cert); + X509_free(ss->peer); + if (ss->ciphers != NULL) sk_SSL_CIPHER_free(ss->ciphers); + free(ss->tlsext_hostname); free(ss->tlsext_tick); free(ss->internal->tlsext_ecpointformatlist); -- cgit v1.2.3-55-g6feb