MINOR: quic: Release asap the negotiated Initial TLS context.

This context may be released at the same time as the Initial TLS context.
This is done calling quic_tls_ctx_secs_free() and pool_free() in two code locations.
Implement quic_nictx_free() to do that.
This commit is contained in:
Frédéric Lécaille
2023-07-04 11:09:25 +02:00
parent 90a63ae4fa
commit 2b8510d722
2 changed files with 14 additions and 0 deletions

View File

@@ -757,6 +757,16 @@ static inline int quic_tls_secrets_keys_alloc(struct quic_tls_secrets *secs)
return 0;
}
/* Release the memory allocated for the negotiated Initial QUIC TLS context
* attached to <qc> connection.
*/
static inline void quic_nictx_free(struct quic_conn *qc)
{
quic_tls_ctx_secs_free(qc->nictx);
pool_free(pool_head_quic_tls_ctx, qc->nictx);
qc->nictx = NULL;
}
/* Initialize a TLS cryptographic context for the Initial encryption level. */
static inline int quic_initial_tls_ctx_init(struct quic_tls_ctx *ctx)
{