dovecot-2.0: mdbox: Don't crash when rebuilding index if there's...

dovecot at dovecot.org dovecot at dovecot.org
Fri Mar 19 15:15:45 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/d133801d8e83
changeset: 10947:d133801d8e83
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Mar 19 15:15:43 2010 +0200
description:
mdbox: Don't crash when rebuilding index if there's no alt storage dir.

diffstat:

 src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (22 lines):

diff -r 0cf62ad4c7bf -r d133801d8e83 src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c
--- a/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c	Fri Mar 19 15:13:24 2010 +0200
+++ b/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c	Fri Mar 19 15:15:43 2010 +0200
@@ -817,12 +817,13 @@
 	if (mdbox_storage_rebuild_scan_dir(ctx, ctx->storage->storage_dir,
 					   FALSE) < 0)
 		return -1;
-	if (mdbox_storage_rebuild_scan_dir(ctx, ctx->storage->alt_storage_dir,
-					   TRUE) < 0)
-		return -1;
+	if (ctx->storage->alt_storage_dir != NULL) {
+		if (mdbox_storage_rebuild_scan_dir(ctx,
+				ctx->storage->alt_storage_dir, TRUE) < 0)
+			return -1;
+	}
 
-	if (ret < 0 ||
-	    rebuild_apply_map(ctx) < 0 ||
+	if (rebuild_apply_map(ctx) < 0 ||
 	    rebuild_mailboxes(ctx) < 0 ||
 	    rebuild_finish(ctx) < 0 ||
 	    mail_index_sync_commit(&ctx->sync_ctx) < 0)


More information about the dovecot-cvs mailing list