Skip to content

Commit 75d5c74

Browse files
lxinchucklever
authored andcommitted
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 <[email protected]>
1 parent 2f609c5 commit 75d5c74

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/tlshd/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ void tlshd_quic_clienthello_handshake(struct tlshd_handshake_parms *parms)
611611
ret = tlshd_quic_conn_create(&conn, parms);
612612
if (ret) {
613613
parms->session_status = -ret;
614-
return gnutls_global_deinit();
614+
return;
615615
}
616616

617617
switch (parms->auth_mode) {

src/tlshd/server.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,8 @@ void tlshd_quic_serverhello_handshake(struct tlshd_handshake_parms *parms)
577577

578578
ret = tlshd_quic_conn_create(&conn, parms);
579579
if (ret) {
580-
parms->session_status = ret;
581-
return gnutls_global_deinit();
580+
parms->session_status = -ret;
581+
return;
582582
}
583583

584584
switch (parms->auth_mode) {

0 commit comments

Comments
 (0)