Skip to content

Commit

Permalink
doveadm-server: Deinitialize log proxying before closing SSL iostream
Browse files Browse the repository at this point in the history
Otherwise the SSL iostream destroying may trigger debug/error logging,
which attempts to proxy logs when the stream is already closed. This
caused a panic.
  • Loading branch information
sirainen authored and Timo Sirainen committed Nov 1, 2017
1 parent a36cac1 commit 103e63c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/doveadm/client-connection-tcp.c
Expand Up @@ -597,13 +597,12 @@ client_connection_tcp_free(struct client_connection *_conn)
doveadm_print_deinit();
doveadm_print_ostream = NULL;

if (conn->ssl_iostream != NULL)
ssl_iostream_destroy(&conn->ssl_iostream);

if (conn->log_out != NULL) {
doveadm_server_restore_logs();
o_stream_unref(&conn->log_out);
}
if (conn->ssl_iostream != NULL)
ssl_iostream_destroy(&conn->ssl_iostream);

io_remove(&conn->io);
o_stream_destroy(&conn->output);
Expand Down

0 comments on commit 103e63c

Please sign in to comment.