]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
stats: Fixed ADD-USER stats tracking (auth stats)
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 5 May 2016 11:58:46 +0000 (14:58 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 5 May 2016 12:00:52 +0000 (15:00 +0300)
src/stats/mail-user.c

index 3358483fa76d049a1dbebd910cbdaf924bc9de3a..6e0f7b87c6266b94cf0a09e9e91f1f379a861e3f 100644 (file)
@@ -122,7 +122,7 @@ void mail_user_refresh(struct mail_user *user,
 int mail_user_add_parse(const char *const *args, const char **error_r)
 {
        struct mail_user *user;
-       struct stats *diff_stats;
+       struct stats *empty_stats, *diff_stats;
        buffer_t *buf;
        const char *service, *error;
 
@@ -141,8 +141,9 @@ int mail_user_add_parse(const char *const *args, const char **error_r)
                                           user->name, service);
                return -1;
        }
+       empty_stats = stats_alloc(pool_datastack_create());
        diff_stats = stats_alloc(pool_datastack_create());
-       if (!stats_import(buf->data, buf->used, user->stats, diff_stats, &error)) {
+       if (!stats_import(buf->data, buf->used, empty_stats, diff_stats, &error)) {
                *error_r = t_strdup_printf("ADD-USER %s %s: %s",
                                           user->name, service, error);
                return -1;