Skip to content

Commit

Permalink
fixup! Move freeing of an old enc_write_ctx/write_hash to dtls1_clear…
Browse files Browse the repository at this point in the history
…_sent_buffer
  • Loading branch information
mattcaswell committed Nov 10, 2023
1 parent e963b65 commit 4551874
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ssl/ssl_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,8 +1212,6 @@ void SSL_free(SSL *s)
SSL_SESSION_free(s->psksession);
OPENSSL_free(s->psksession_id);

clear_ciphers(s);

ssl_cert_free(s->cert);
OPENSSL_free(s->shared_sigalgs);
/* Free up if allocated */
Expand Down Expand Up @@ -1249,6 +1247,12 @@ void SSL_free(SSL *s)
if (s->method != NULL)
s->method->ssl_free(s);

/*
* Must occur after s->method->ssl_free(). The DTLS sent_messages queue
* may reference the EVP_CIPHER_CTX/EVP_MD_CTX that are freed here.
*/
clear_ciphers(s);

SSL_CTX_free(s->ctx);

ASYNC_WAIT_CTX_free(s->waitctx);
Expand Down

0 comments on commit 4551874

Please sign in to comment.