]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add CRYPTO_FREE_REF to ossl_quic_free_token_store
authorNeil Horman <nhorman@openssl.org>
Wed, 13 Aug 2025 14:12:38 +0000 (10:12 -0400)
committerNeil Horman <nhorman@openssl.org>
Thu, 14 Aug 2025 15:19:52 +0000 (11:19 -0400)
ossl_quic_free_token_store doesn't call CRYPTO_FREE_REF on the
hdl->reference object, which could lead to memory leaks on platforms
that don't support atomics (where the call to CRYPTO_NEW_REF allocates a
mutex as part of its function.  It wasn't caught before because all the
platforms we do ci on support threads.

Fixes #28241

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28247)

ssl/quic/quic_impl.c

index 6e5970181c824205636c4f4da810f284d52aca8d..baae2dddba82289e731104154e3f24be3ebe68c3 100644 (file)
@@ -4778,6 +4778,7 @@ void ossl_quic_free_token_store(SSL_TOKEN_STORE *hdl)
     ossl_crypto_mutex_free(&hdl->mutex);
     lh_QUIC_TOKEN_doall(hdl->cache, free_this_token);
     lh_QUIC_TOKEN_free(hdl->cache);
+    CRYPTO_FREE_REF(&hdl->references);
     OPENSSL_free(hdl);
     return;
 }