Skip to content

Commit

Permalink
ngtcp2: fix memory leak on connect failure
Browse files Browse the repository at this point in the history
When a QUIC connection using ngtcp2 failed immediately, the TLS
instances were not always released.

Closes curl#16113
  • Loading branch information
icing authored and bagder committed Jan 28, 2025
1 parent f6da270 commit 399ca56
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/vquic/curl_ngtcp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 399ca56

Please sign in to comment.