Free up the memory for the NewSessionTicket extensions
authorMatt Caswell <matt@openssl.org>
Mon, 30 Jan 2017 19:37:17 +0000 (19:37 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 30 Jan 2017 22:58:54 +0000 (22:58 +0000)
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2326)

ssl/statem/statem_clnt.c

index d5d933c..6bd7481 100644 (file)
@@ -2323,6 +2323,7 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt)
 
     /* This is a standalone message in TLSv1.3, so there is no more to read */
     if (SSL_IS_TLS13(s)) {
+        OPENSSL_free(exts);
         ssl_update_cache(s, SSL_SESS_CACHE_CLIENT);
         return MSG_PROCESS_FINISHED_READING;
     }
@@ -2332,6 +2333,7 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt)
     ssl3_send_alert(s, SSL3_AL_FATAL, al);
  err:
     ossl_statem_set_error(s);
+    OPENSSL_free(exts);
     return MSG_PROCESS_ERROR;
 }