summaryrefslogtreecommitdiffstats
path: root/ssl/quic/quic_tserver.c
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-05-17 13:15:01 +0100
committerHugo Landau <hlandau@openssl.org>2023-05-24 10:34:54 +0100
commit629b408c12c56b2c9e3279de8658718e8dd658a2 (patch)
tree13916b230422a8d1b27fcf9467ce8bbdcb45646f /ssl/quic/quic_tserver.c
parent1a0de4c1eea1f32a3e1113add26625d49b3854d8 (diff)
QUIC: Fix bugs where threading is disabled
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20856)
Diffstat (limited to 'ssl/quic/quic_tserver.c')
-rw-r--r--ssl/quic/quic_tserver.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c
index 6788851f29..6fc341f3c4 100644
--- a/ssl/quic/quic_tserver.c
+++ b/ssl/quic/quic_tserver.c
@@ -67,8 +67,10 @@ QUIC_TSERVER *ossl_quic_tserver_new(const QUIC_TSERVER_ARGS *args,
srv->args = *args;
+#if defined(OPENSSL_THREADS)
if ((srv->mutex = ossl_crypto_mutex_new()) == NULL)
goto err;
+#endif
srv->ctx = SSL_CTX_new_ex(srv->args.libctx, srv->args.propq, TLS_method());
if (srv->ctx == NULL)
@@ -106,7 +108,9 @@ QUIC_TSERVER *ossl_quic_tserver_new(const QUIC_TSERVER_ARGS *args,
err:
if (srv != NULL) {
ossl_quic_channel_free(srv->ch);
+#if defined(OPENSSL_THREADS)
ossl_crypto_mutex_free(&srv->mutex);
+#endif
}
OPENSSL_free(srv);
@@ -123,7 +127,9 @@ void ossl_quic_tserver_free(QUIC_TSERVER *srv)
BIO_free(srv->args.net_wbio);
SSL_free(srv->tls);
SSL_CTX_free(srv->ctx);
+#if defined(OPENSSL_THREADS)
ossl_crypto_mutex_free(&srv->mutex);
+#endif
OPENSSL_free(srv);
}