From 399ca56be5a66b783476a367a97b256dd5e4c71c Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 28 Jan 2025 13:23:31 +0100 Subject: [PATCH] ngtcp2: fix memory leak on connect failure When a QUIC connection using ngtcp2 failed immediately, the TLS instances were not always released. Closes #16113 --- lib/vquic/curl_ngtcp2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index afe3b9d6b42f..f2ceff27132c 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -175,6 +175,8 @@ static void cf_ngtcp2_ctx_init(struct cf_ngtcp2_ctx *ctx) static void cf_ngtcp2_ctx_free(struct cf_ngtcp2_ctx *ctx) { if(ctx && ctx->initialized) { + Curl_vquic_tls_cleanup(&ctx->tls); + vquic_ctx_free(&ctx->q); Curl_bufcp_free(&ctx->stream_bufcp); Curl_dyn_free(&ctx->scratch); Curl_hash_clean(&ctx->streams);