Mercurial > dovecot > core-2.2
changeset 12638:951d89021e5f
lib-storage: Crashfix.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 05 Feb 2011 04:43:49 +0200 |
parents | 4e4c7f982fd5 |
children | 96c284f7548f |
files | src/lib-storage/list/mailbox-list-subscriptions.c src/lib-storage/mailbox-list.c |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-subscriptions.c Wed Feb 02 05:33:04 2011 +0200 +++ b/src/lib-storage/list/mailbox-list-subscriptions.c Sat Feb 05 04:43:49 2011 +0200 @@ -93,6 +93,7 @@ struct subsfile_list_context *subsfile_ctx; struct stat st; const char *path, *name; + char sep; if ((ns->flags & NAMESPACE_FLAG_SUBSCRIPTIONS) == 0) { /* no subscriptions in this namespace. find where they are. */ @@ -104,6 +105,10 @@ } } + if (list->subscriptions == NULL) { + sep = mail_namespace_get_sep(ns); + list->subscriptions = mailbox_tree_init(sep); + } path = t_strconcat(ns->list->set.control_dir != NULL ? ns->list->set.control_dir : ns->list->set.root_dir, "/", ns->list->set.subscription_fname, NULL);
--- a/src/lib-storage/mailbox-list.c Wed Feb 02 05:33:04 2011 +0200 +++ b/src/lib-storage/mailbox-list.c Sat Feb 05 04:43:49 2011 +0200 @@ -151,7 +151,6 @@ list->dir_create_mode = (mode_t)-1; list->file_create_gid = (gid_t)-1; list->changelog_timestamp = (time_t)-1; - list->subscriptions = mailbox_tree_init(mail_namespace_get_sep(ns)); /* copy settings */ if (set->root_dir != NULL) { @@ -462,7 +461,8 @@ *_list = NULL; i_free_and_null(list->error_string); - mailbox_tree_deinit(&list->subscriptions); + if (list->subscriptions != NULL) + mailbox_tree_deinit(&list->subscriptions); if (list->changelog != NULL) mailbox_log_free(&list->changelog); list->v.deinit(list);