dovecot-2.1: stats: Fixed crash when handling multiple users wit...

dovecot at dovecot.org dovecot at dovecot.org
Wed Nov 28 04:21:14 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/31ed1f5cc8f1
changeset: 14828:31ed1f5cc8f1
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Nov 28 04:21:03 2012 +0200
description:
stats: Fixed crash when handling multiple users within same process.

diffstat:

 src/plugins/stats/stats-plugin.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r 348e9bad84f0 -r 31ed1f5cc8f1 src/plugins/stats/stats-plugin.c
--- a/src/plugins/stats/stats-plugin.c	Wed Nov 28 03:56:06 2012 +0200
+++ b/src/plugins/stats/stats-plugin.c	Wed Nov 28 04:21:03 2012 +0200
@@ -587,9 +587,13 @@
 		stats_global_user = user;
 	} else if (stats_user_count == 1) {
 		/* second user connection. we'll need to start doing
-		   per-io callback tracking now. */
-		stats_add_session(stats_global_user);
-		stats_global_user = NULL;
+		   per-io callback tracking now. (we might have been doing it
+		   also previously but just temporarily quickly dropped to
+		   having 1 user, in which case stats_global_user=NULL) */
+		if (stats_global_user != NULL) {
+			stats_add_session(stats_global_user);
+			stats_global_user = NULL;
+		}
 	}
 	stats_user_count++;
 


More information about the dovecot-cvs mailing list