]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Don't keep mail_user.set_parser referenced
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 7 Feb 2023 23:25:47 +0000 (01:25 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Nov 2023 12:20:55 +0000 (14:20 +0200)
It's always just a direct pointer to service_userr->set_parser, so the
reference isn't needed. Also the following changes will change this to
a non-reference counted "settings instance", which makes this change
necessary.

src/lib-storage/mail-user.c
src/lib-storage/mail-user.h

index 9add4c930fe8bb92891184152dce9db3be000ff9..b35e8be3506f1d2a44a435154c1e4bcdc48ef071 100644 (file)
@@ -95,7 +95,6 @@ mail_user_alloc(struct mail_storage_service_user *service_user)
        mail_storage_service_user_ref(service_user);
        user->username = p_strdup(pool, username);
        user->set_parser = service_user_set_parser;
-       settings_parser_ref(user->set_parser);
        user->set = mail_storage_service_user_get_set(service_user);
        user->service = master_service_get_name(master_service);
        user->default_normalizer = uni_utf8_to_decomposed_titlecase;
@@ -233,7 +232,6 @@ void mail_user_unref(struct mail_user **_user)
                user->v.deinit_pre(user);
                user->v.deinit(user);
        } T_END;
-       settings_parser_unref(&user->set_parser);
        master_service_settings_free(user->_mail_set);
        event_unref(&user->event);
        i_assert(user->refcount == 1);
index cfa7ddf8168bada3435d4cd69f489c9af371751d..a34f0e6fe881dbc62c202ad8754f442b8b86eb6a 100644 (file)
@@ -57,6 +57,7 @@ struct mail_user {
           This could be set by plugins that need to fail the initialization. */
        const char *error;
 
+       /* Points to service_user->set_parser */
        struct setting_parser_context *set_parser;
        const struct mail_user_settings *set;
        struct mail_storage_settings *_mail_set;