]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Don't crash on getting alt root dir, when no alt dir is specified.
authorTimo Sirainen <tss@iki.fi>
Tue, 16 Aug 2011 19:52:19 +0000 (22:52 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 16 Aug 2011 19:52:19 +0000 (22:52 +0300)
src/lib-storage/mailbox-list.c

index 833d805c154918d64dc37e6825cfb46841f94696..a497d57d09845fae19f01a63ea2e389b3cd13cb0 100644 (file)
@@ -924,7 +924,7 @@ mailbox_list_get_root_path(const struct mailbox_list_settings *set,
                        return set->root_dir;
                path = t_strconcat(set->alt_dir, "/",
                                   set->mailbox_dir_name, NULL);
-               return t_strndup(path, strlen(path)-1);
+               return path == NULL ? NULL : t_strndup(path, strlen(path)-1);
        case MAILBOX_LIST_PATH_TYPE_CONTROL:
                return set->control_dir != NULL ?
                        set->control_dir : set->root_dir;