summaryrefslogtreecommitdiff
path: root/lib/vquic
diff options
context:
space:
mode:
authorStefan Eissing <stefan@eissing.org>2023-02-23 16:54:02 +0100
committerDaniel Stenberg <daniel@haxx.se>2023-02-24 08:43:35 +0100
commitf6fe54e21edfb343a746c017e646669bbb1a105a (patch)
treeb750e89465b6e19db29af97819e8e77dda975252 /lib/vquic
parent0242eba06e8466685c2b0fcbad581bc3d7032134 (diff)
downloadcurl-f6fe54e21edfb343a746c017e646669bbb1a105a.tar.gz
ngtcp2: fix unwanted close of file descriptor 0
... causing macOS to hand out 0 as next socket handle and failing on further operations. Reported-by: Sergey Fionov Fixes #10593 Closes #10595
Diffstat (limited to 'lib/vquic')
-rw-r--r--lib/vquic/curl_ngtcp2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c
index ffdaeade3..aad095c20 100644
--- a/lib/vquic/curl_ngtcp2.c
+++ b/lib/vquic/curl_ngtcp2.c
@@ -2127,7 +2127,6 @@ static void cf_ngtcp2_ctx_clear(struct cf_ngtcp2_ctx *ctx)
if(ctx->qlogfd != -1) {
close(ctx->qlogfd);
- ctx->qlogfd = -1;
}
#ifdef USE_OPENSSL
if(ctx->ssl)
@@ -2155,6 +2154,7 @@ static void cf_ngtcp2_ctx_clear(struct cf_ngtcp2_ctx *ctx)
ngtcp2_conn_del(ctx->qconn);
memset(ctx, 0, sizeof(*ctx));
+ ctx->qlogfd = -1;
ctx->call_data = save;
}
@@ -2470,6 +2470,7 @@ CURLcode Curl_cf_ngtcp2_create(struct Curl_cfilter **pcf,
result = CURLE_OUT_OF_MEMORY;
goto out;
}
+ ctx->qlogfd = -1;
cf_ngtcp2_ctx_clear(ctx);
result = Curl_cf_create(&cf, &Curl_cft_http3, ctx);