[dovecot-cvs] dovecot/src/lib-index mail-index.c,1.249,1.250

tss at dovecot.org tss at dovecot.org
Wed Dec 20 03:16:47 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv32269

Modified Files:
	mail-index.c 
Log Message:
If mail_index_move_to_memory() was called before index file was opened, we
didn't properly mark it as "in-memory".



Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.249
retrieving revision 1.250
diff -u -d -r1.249 -r1.250
--- mail-index.c	17 Dec 2006 16:35:32 -0000	1.249
+++ mail-index.c	20 Dec 2006 03:16:44 -0000	1.250
@@ -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);



More information about the dovecot-cvs mailing list