dovecot-1.2: imap/pop3-login: Don't crash when shutting down and...

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 2 21:25:43 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/fbb2343b85d9
changeset: 8891:fbb2343b85d9
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 697f380acfbb -r fbb2343b85d9 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
@@ -687,11 +687,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 697f380acfbb -r fbb2343b85d9 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