From: Timo Sirainen Date: Mon, 2 May 2016 21:25:43 +0000 (+0300) Subject: lib-storage: Another fix to mail storage initialization. X-Git-Tag: 2.3.0.rc1~3862 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9cd4b2da8ef71d5216cc49d8b46fbabd47d472db;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Another fix to mail storage initialization. Allow mail_namespaces_init_location() to add the namespace directly to user, since that's what the current callers always want. But compared to the original code we're now calling mail_namespaces_init_finish() rather than doing the same things ourself. --- diff --git a/src/lib-storage/mail-namespace.c b/src/lib-storage/mail-namespace.c index a8ac2c6c1d..6b80894626 100644 --- a/src/lib-storage/mail-namespace.c +++ b/src/lib-storage/mail-namespace.c @@ -405,8 +405,7 @@ int mail_namespaces_init(struct mail_user *user, const char **error_r) if (namespaces == NULL) { /* no namespaces defined, create a default one */ - if (mail_namespaces_init_location(user, NULL, error_r) < 0) - return -1; + return mail_namespaces_init_location(user, NULL, error_r); } return mail_namespaces_init_finish(namespaces, error_r); } @@ -492,7 +491,7 @@ int mail_namespaces_init_location(struct mail_user *user, const char *location, mail_namespace_free(ns); return -1; } - return 0; + return mail_namespaces_init_finish(ns, error_r); } struct mail_namespace *mail_namespaces_init_empty(struct mail_user *user)