[dovecot-cvs] dovecot/src/lib-index mail-index.c, 1.230.2.27, 1.230.2.28
tss at dovecot.org
tss at dovecot.org
Thu Mar 15 14:04:40 EET 2007
Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv7970
Modified Files:
Tag: branch_1_0
mail-index.c
Log Message:
Error handling crashfix
Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.230.2.27
retrieving revision 1.230.2.28
diff -u -d -r1.230.2.27 -r1.230.2.28
--- mail-index.c 14 Mar 2007 19:39:24 -0000 1.230.2.27
+++ mail-index.c 15 Mar 2007 12:04:38 -0000 1.230.2.28
@@ -1719,8 +1719,9 @@
i_assert(index->excl_lock_count == 0);
old_map = index->map;
+ if (old_map != NULL)
+ old_map->refcount++;
old_fd = index->fd;
- old_map->refcount++;
/* new file, new locks. the old fd can keep its locks, they don't
matter anymore as no-one's going to modify the file. */
@@ -1758,7 +1759,8 @@
mail_index_unlock(index, lock_id);
if (ret == 0) {
- mail_index_unmap(index, &old_map);
+ if (old_map != NULL)
+ mail_index_unmap(index, &old_map);
if (close(old_fd) < 0)
mail_index_set_syscall_error(index, "close()");
} else {
More information about the dovecot-cvs
mailing list