]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Free pre_proc_exts in SSL_free()
authorMiłosz Kaniewski <milosz.kaniewski@gmail.com>
Tue, 30 Jun 2020 19:46:38 +0000 (21:46 +0200)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 2 Jul 2020 00:26:32 +0000 (17:26 -0700)
Usually it will be freed in tls_early_post_process_client_hello().
However if a ClientHello callback will be used and will return
SSL_CLIENT_HELLO_RETRY then tls_early_post_process_client_hello()
may never come to the point where pre_proc_exts is freed.

Fixes #12194

CLA: trivial

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/12330)

(cherry picked from commit 94941cada25433a7dca35b5b9f8cbb751ab65ab3)

ssl/ssl_lib.c

index f6a4964ed27dcb5c15a2cf9c5280213938867ba1..433a53796995885f6cb172a7c36d5009d26195fe 100644 (file)
@@ -1200,6 +1200,8 @@ void SSL_free(SSL *s)
     OPENSSL_free(s->ext.ocsp.resp);
     OPENSSL_free(s->ext.alpn);
     OPENSSL_free(s->ext.tls13_cookie);
+    if (s->clienthello != NULL)
+        OPENSSL_free(s->clienthello->pre_proc_exts);
     OPENSSL_free(s->clienthello);
     OPENSSL_free(s->pha_context);
     EVP_MD_CTX_free(s->pha_dgst);