Skip to content

Commit

Permalink
Free pre_proc_exts in SSL_free()
Browse files Browse the repository at this point in the history
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 openssl#12194

CLA: trivial

Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Ben Kaduk <[email protected]>
(Merged from openssl#12330)
  • Loading branch information
mkaniewski authored and kaduk committed Jul 2, 2020
1 parent 69f9826 commit 94941ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ssl/ssl_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,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);
Expand Down

0 comments on commit 94941ca

Please sign in to comment.