[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.181.2.4, 1.181.2.5

tss at dovecot.org tss at dovecot.org
Thu Oct 26 12:28:37 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv24860

Modified Files:
      Tag: branch_1_0
	mbox-sync.c 
Log Message:
Crashfix



Index: mbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.181.2.4
retrieving revision 1.181.2.5
diff -u -d -r1.181.2.4 -r1.181.2.5
--- mbox-sync.c	26 Oct 2006 00:17:22 -0000	1.181.2.4
+++ mbox-sync.c	26 Oct 2006 11:28:35 -0000	1.181.2.5
@@ -794,13 +794,17 @@
 	i_assert(mail_ctx->mail.uid == 0 || mail_ctx->mail.space > 0 ||
 		 mail_ctx->mail.offset == mail_ctx->hdr_offset);
 
-	/* mail's keywords are allocated from a pool that's cleared for each
-	   mail. we'll need to copy it to something more permanent. */
-	ARRAY_CREATE(&keywords_copy, sync_ctx->saved_keywords_pool,
-		     unsigned int, array_count(&mail_ctx->mail.keywords));
-	array_append_array(&keywords_copy, &mail_ctx->mail.keywords);
-	mail_ctx->mail.keywords = keywords_copy;
-	array_append(&sync_ctx->mails, &mail_ctx->mail, 1);
+	if (array_is_created(&mail_ctx->mail.keywords)) {
+		/* mail's keywords are allocated from a pool that's cleared
+		   for each mail. we'll need to copy it to something more
+		   permanent. */
+		ARRAY_CREATE(&keywords_copy, sync_ctx->saved_keywords_pool,
+			     unsigned int,
+			     array_count(&mail_ctx->mail.keywords));
+		array_append_array(&keywords_copy, &mail_ctx->mail.keywords);
+		mail_ctx->mail.keywords = keywords_copy;
+		array_append(&sync_ctx->mails, &mail_ctx->mail, 1);
+	}
 
 	sync_ctx->space_diff += mail_ctx->mail.space;
 	if (sync_ctx->space_diff < 0) {



More information about the dovecot-cvs mailing list