From d26d53604942e9329396e29ab71f6ba8124a475c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 19 Oct 2010 20:20:18 +0100 Subject: [PATCH] pop3: Don't crash if client disconnects in output handler. --- src/pop3/pop3-client.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pop3/pop3-client.c b/src/pop3/pop3-client.c index 66d4eb17ee..125aa60d69 100644 --- a/src/pop3/pop3-client.c +++ b/src/pop3/pop3-client.c @@ -662,8 +662,12 @@ static int client_output(struct client *client) client->io = io_add(i_stream_get_fd(client->input), IO_READ, client_input, client); } - if (client->io != NULL && client->waiting_input) - client_input(client); + if (client->io != NULL && client->waiting_input) { + if (!client_handle_input(client)) { + /* client got destroyed */ + return 1; + } + } } o_stream_uncork(client->output); -- 2.47.3