From: Timo Sirainen Date: Wed, 28 Nov 2012 02:21:03 +0000 (+0200) Subject: stats: Fixed crash when handling multiple users within same process. X-Git-Tag: 2.1.11~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14d7b92eac24469cac5933da5ba549a51efde7f6;p=thirdparty%2Fdovecot%2Fcore.git stats: Fixed crash when handling multiple users within same process. --- diff --git a/src/plugins/stats/stats-plugin.c b/src/plugins/stats/stats-plugin.c index 5362426bbd..1a1682c84e 100644 --- a/src/plugins/stats/stats-plugin.c +++ b/src/plugins/stats/stats-plugin.c @@ -587,9 +587,13 @@ static void stats_user_created(struct mail_user *user) 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++;