From: Timo Sirainen Date: Tue, 19 Oct 2010 19:20:18 +0000 (+0100) Subject: pop3: Don't crash if client disconnects in output handler. X-Git-Tag: 2.0.6~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d26d53604942e9329396e29ab71f6ba8124a475c;p=thirdparty%2Fdovecot%2Fcore.git pop3: Don't crash if client disconnects in output handler. --- 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);