changeset 13268:da8da4a11039

lib-storage: Don't crash on getting alt root dir, when no alt dir is specified.
author Timo Sirainen <tss@iki.fi>
date Tue, 16 Aug 2011 22:52:19 +0300
parents 1a40ebfedaa2
children 8aeeaf770612
files src/lib-storage/mailbox-list.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/mailbox-list.c	Tue Aug 16 22:36:04 2011 +0300
+++ b/src/lib-storage/mailbox-list.c	Tue Aug 16 22:52:19 2011 +0300
@@ -924,7 +924,7 @@
 			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;