diff options
-rw-r--r-- | ssl/statem/extensions.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ssl/statem/extensions.c b/ssl/statem/extensions.c index 307e6b9d6f..cd4f078cf3 100644 --- a/ssl/statem/extensions.c +++ b/ssl/statem/extensions.c @@ -938,11 +938,8 @@ static int final_server_name(SSL *s, unsigned int context, int sent) * was successful. */ if (s->server) { - if (!sent) { - /* Nothing from the client this handshake; cleanup stale value */ - OPENSSL_free(s->ext.hostname); - s->ext.hostname = NULL; - } else if (ret == SSL_TLSEXT_ERR_OK && (!s->hit || SSL_IS_TLS13(s))) { + /* TODO(OpenSSL1.2) revisit !sent case */ + if (sent && ret == SSL_TLSEXT_ERR_OK && (!s->hit || SSL_IS_TLS13(s))) { /* Only store the hostname in the session if we accepted it. */ OPENSSL_free(s->session->ext.hostname); s->session->ext.hostname = OPENSSL_strdup(s->ext.hostname); |