Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/flb_upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,6 @@ static int prepare_destroy_conn(struct flb_connection *u_conn)
}

if (u_conn->fd > 0) {
#ifdef FLB_HAVE_TLS
if (u_conn->tls_session != NULL) {
flb_tls_session_destroy(u_conn->tls_session);

u_conn->tls_session = NULL;
}
#endif
shutdown_connection(u_conn);

flb_socket_close(u_conn->fd);
Expand Down Expand Up @@ -572,6 +565,15 @@ static int destroy_conn(struct flb_connection *u_conn)
return 0;
}

/* Delay to destroy TLS session for safety */
#ifdef FLB_HAVE_TLS
if (u_conn->tls_session != NULL) {
flb_tls_session_destroy(u_conn->tls_session);

u_conn->tls_session = NULL;
}
#endif

mk_list_del(&u_conn->_head);

flb_connection_destroy(u_conn);
Expand Down
Loading