[dovecot-cvs] dovecot/src/lib-index mail-index-dummy-view.c, 1.3, 1.4 mail-index-view.c, 1.57, 1.58

tss at dovecot.org tss at dovecot.org
Tue Apr 17 19:02:40 EEST 2007


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

Modified Files:
	mail-index-dummy-view.c mail-index-view.c 
Log Message:
mail_index_view.module_contexts array wasn't initialized.



Index: mail-index-dummy-view.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-dummy-view.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mail-index-dummy-view.c	28 Jun 2006 16:31:05 -0000	1.3
+++ mail-index-dummy-view.c	17 Apr 2007 16:02:36 -0000	1.4
@@ -1,6 +1,7 @@
 /* Copyright (C) 2004 Timo Sirainen */
 
 #include "lib.h"
+#include "array.h"
 #include "mail-index-private.h"
 #include "mail-index-view-private.h"
 
@@ -8,6 +9,7 @@
 {
 	i_assert(view->refcount == 0);
 
+	array_free(&view->module_contexts);
 	i_free(view);
 }
 
@@ -37,5 +39,7 @@
 	view->refcount = 1;
 	view->v = dummy_view_vfuncs;
 	view->index = index;
+	i_array_init(&view->module_contexts,
+		     I_MIN(5, mail_index_module_register.id));
 	return view;
 }

Index: mail-index-view.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-view.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- mail-index-view.c	2 Feb 2007 10:30:15 -0000	1.57
+++ mail-index-view.c	17 Apr 2007 16:02:36 -0000	1.58
@@ -27,6 +27,9 @@
 
 	dest->log_file_seq = src->log_file_seq;
 	dest->log_file_offset = src->log_file_offset;
+
+	i_array_init(&dest->module_contexts,
+		     I_MIN(5, mail_index_module_register.id));
 }
 
 void mail_index_view_ref(struct mail_index_view *view)
@@ -50,6 +53,7 @@
 		mail_index_view_unref_maps(view);
 		array_free(&view->map_refs);
 	}
+	array_free(&view->module_contexts);
 	i_free(view);
 }
 
@@ -712,6 +716,9 @@
 	view->log_file_offset =
 		I_MIN(view->map->hdr.log_file_int_offset,
 		      view->map->hdr.log_file_ext_offset);
+
+	i_array_init(&view->module_contexts,
+		     I_MIN(5, mail_index_module_register.id));
 	return view;
 }
 



More information about the dovecot-cvs mailing list