Skip to content

Commit

Permalink
QUIC APL: Free listeners correctly
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from #23334)
  • Loading branch information
hlandau committed Apr 19, 2024
1 parent 4e40ff9 commit 80dbbf9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ssl/quic/quic_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,28 @@ static void qc_cleanup(QUIC_CONNECTION *qc, int have_lock)
}

/* SSL_free */
QUIC_TAKES_LOCK
static void quic_free_listener(QCTX *ctx)
{
ossl_quic_port_free(ctx->ql->port);
ossl_quic_engine_free(ctx->ql->engine);
ossl_crypto_mutex_free(&ctx->ql->mutex);
}

QUIC_TAKES_LOCK
void ossl_quic_free(SSL *s)
{
QCTX ctx;
int is_default;

/* We should never be called on anything but a QSO. */
if (!expect_quic(s, &ctx))
if (!expect_quic_any(s, &ctx))
return;

if (ctx.is_listener) {
quic_free_listener(&ctx);
return;
}

qctx_lock(&ctx);

Expand Down

0 comments on commit 80dbbf9

Please sign in to comment.