]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Don't unnecessarily duplicate user's all setting strings
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 4 Feb 2017 11:38:17 +0000 (13:38 +0200)
committerGitLab <gitlab@git.dovecot.net>
Mon, 6 Feb 2017 08:21:46 +0000 (10:21 +0200)
user->unexpanded_set and user->set have the same life-time, so they can
point to same strings.

src/lib-storage/mail-user.c

index 334ed30c7b8fc48049ba0a29757a6ff5bb5f163e..16a72ae9f5fc07de9cad380314bc68add24f3737 100644 (file)
@@ -61,7 +61,7 @@ struct mail_user *mail_user_alloc(const char *username,
        user->username = p_strdup(pool, username);
        user->set_info = set_info;
        user->unexpanded_set = settings_dup(set_info, set, pool);
-       user->set = settings_dup(set_info, set, pool);
+       user->set = settings_dup_with_pointers(set_info, user->unexpanded_set, pool);
        user->service = master_service_get_name(master_service);
        user->default_normalizer = uni_utf8_to_decomposed_titlecase;
        user->session_create_time = ioloop_time;