changeset 4919:d54145736f99 HEAD

If mail_index_move_to_memory() was called before index file was opened, we didn't properly mark it as "in-memory".
author Timo Sirainen <tss@iki.fi>
date Wed, 20 Dec 2006 05:16:44 +0200
parents 2f9173e103fd
children b25483838ab8
files src/lib-index/mail-index.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index.c	Sun Dec 17 18:35:31 2006 +0200
+++ b/src/lib-index/mail-index.c	Wed Dec 20 05:16:44 2006 +0200
@@ -1815,6 +1815,9 @@
 	if (MAIL_INDEX_IS_IN_MEMORY(index))
 		return 0;
 
+	/* set the index as being into memory */
+	i_free_and_null(index->dir);
+
 	if (index->map == NULL) {
 		/* mbox file was never even opened. just mark it as being in
 		   memory and let the caller re-open the index. */
@@ -1822,9 +1825,6 @@
 		return -1;
 	}
 
-	/* set the index as being into memory */
-	i_free_and_null(index->dir);
-
 	/* move index map to memory */
 	map = mail_index_map_clone(index->map, index->map->hdr.record_size);
 	mail_index_unmap(index, &index->map);