From a8aed50b3b7eec29c8ce10a74a97426fd1b163ae Mon Sep 17 00:00:00 2001 From: Xin Long Date: Tue, 20 May 2025 11:30:58 -0400 Subject: [PATCH] tlshd: remove redundant gnutls_global_deinit() The call to gnutls_global_deinit() in tlshd_quic_clienthello_handshake() and tlshd_quic_serverhello_handshake() is redundant, as it is already invoked by their common caller tlshd_service_socket(). Remove these unbalanced deinitialization calls to avoid potential misuse or double deinitialization. Additionally, fix the error handling to assign -ret to session_status instead of ret for consistency with other error paths. Signed-off-by: Xin Long --- src/tlshd/client.c | 2 +- src/tlshd/server.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tlshd/client.c b/src/tlshd/client.c index 4940256..9c8f512 100644 --- a/src/tlshd/client.c +++ b/src/tlshd/client.c @@ -611,7 +611,7 @@ void tlshd_quic_clienthello_handshake(struct tlshd_handshake_parms *parms) ret = tlshd_quic_conn_create(&conn, parms); if (ret) { parms->session_status = -ret; - return gnutls_global_deinit(); + return; } switch (parms->auth_mode) { diff --git a/src/tlshd/server.c b/src/tlshd/server.c index 9468a61..72ff6f5 100644 --- a/src/tlshd/server.c +++ b/src/tlshd/server.c @@ -577,8 +577,8 @@ void tlshd_quic_serverhello_handshake(struct tlshd_handshake_parms *parms) ret = tlshd_quic_conn_create(&conn, parms); if (ret) { - parms->session_status = ret; - return gnutls_global_deinit(); + parms->session_status = -ret; + return; } switch (parms->auth_mode) {