]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ngtcp2: fix memory leak on connect failure
authorStefan Eissing <stefan@eissing.org>
Tue, 28 Jan 2025 12:23:31 +0000 (13:23 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 28 Jan 2025 13:12:42 +0000 (14:12 +0100)
When a QUIC connection using ngtcp2 failed immediately, the TLS
instances were not always released.

Closes #16113

lib/vquic/curl_ngtcp2.c

index afe3b9d6b42f077463c1d0ee181e2cfdcf323321..f2ceff27132c40259e509238c0025672bd4bf64c 100644 (file)
@@ -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);