[dovecot-cvs] dovecot/src/lib-index mail-index.c,1.142,1.143
cras at dovecot.org
cras at dovecot.org
Fri Sep 3 22:27:00 EEST 2004
Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv27216/lib-index
Modified Files:
mail-index.c
Log Message:
When updating index mappings, don't let it affect existing views mappings.
Fixes some crashes.
Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- mail-index.c 31 Jul 2004 04:14:01 -0000 1.142
+++ mail-index.c 3 Sep 2004 19:26:57 -0000 1.143
@@ -344,6 +344,13 @@
size_t used_size;
int ret;
+ if (index->map != NULL && index->map->refcount > 1) {
+ /* this map is already used by some views and they may have
+ pointers into it. leave them and create a new mapping. */
+ index->map->refcount--;
+ index->map = NULL;
+ }
+
map = index->map;
if (map == NULL) {
map = i_new(struct mail_index_map, 1);
More information about the dovecot-cvs
mailing list