dovecot-1.1: imap/pop3-login: Don't crash when shutting down and...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Apr 2 21:25:32 EEST 2009
details: http://hg.dovecot.org/dovecot-1.1/rev/34d6b5b7864b
changeset: 8233:34d6b5b7864b
user: Timo Sirainen <tss at iki.fi>
date: Thu Apr 02 14:25:27 2009 -0400
description:
imap/pop3-login: Don't crash when shutting down and destroying clients.
diffstat:
2 files changed, 8 insertions(+), 6 deletions(-)
src/imap-login/client.c | 7 ++++---
src/pop3-login/client.c | 7 ++++---
diffs (38 lines):
diff -r f17f4b3d002b -r 34d6b5b7864b src/imap-login/client.c
--- a/src/imap-login/client.c Thu Apr 02 14:10:16 2009 -0400
+++ b/src/imap-login/client.c Thu Apr 02 14:25:27 2009 -0400
@@ -626,11 +626,12 @@ void clients_notify_auth_connected(void)
void clients_destroy_all(void)
{
- struct client *client;
-
- for (client = clients; client != NULL; client = client->next) {
+ struct client *client, *next;
+
+ for (client = clients; client != NULL; client = next) {
struct imap_client *imap_client = (struct imap_client *)client;
+ next = client->next;
client_destroy(imap_client, "Disconnected: Shutting down");
}
}
diff -r f17f4b3d002b -r 34d6b5b7864b src/pop3-login/client.c
--- a/src/pop3-login/client.c Thu Apr 02 14:10:16 2009 -0400
+++ b/src/pop3-login/client.c Thu Apr 02 14:25:27 2009 -0400
@@ -479,11 +479,12 @@ void clients_notify_auth_connected(void)
void clients_destroy_all(void)
{
- struct client *client;
-
- for (client = clients; client != NULL; client = client->next) {
+ struct client *client, *next;
+
+ for (client = clients; client != NULL; client = next) {
struct pop3_client *pop3_client = (struct pop3_client *)client;
+ next = client->next;
client_destroy(pop3_client, "Disconnected: Shutting down");
}
}
More information about the dovecot-cvs
mailing list