From d57b95aab7afc771c9e3dd0def0821baeddce6f2 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Tue, 16 Jul 2024 10:51:02 +0200 Subject: [PATCH] BUG/MINOR: do not close uninit FD in quic_test_socketops() On startup, quic_test_socketops() is called to ensure that chosen configuration option are compatible with UDP system stack. A dummy FD is allocated to invoke various setsockopt() settings. If no tests are required, FD is not allocated. In this case, close() should not be close. This is mostly for better coding as this does not cause any real issue for users. This should fix github issue #2638. No need to backport. --- src/proto_quic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/proto_quic.c b/src/proto_quic.c index 60aad85db..7456be629 100644 --- a/src/proto_quic.c +++ b/src/proto_quic.c @@ -577,7 +577,8 @@ static int quic_test_socketopts(struct listener *l) #endif } - close(fdtest); + if (fdtest >= 0) + close(fdtest); return ERR_NONE; err: