aboutsummaryrefslogtreecommitdiff
path: root/mail/dbmail21/files/patch-2.1.7_001_383
blob: 3dfd1954f67bfd80e8b0b4a3f1fe3a99721feb33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Index: modules/sortsieve.c
===================================================================
--- modules/sortsieve.c	(revision 2211)
+++ modules/sortsieve.c	(revision 2212)
@@ -198,11 +198,10 @@
 	}
 
 	/* If there were any imapflags, set them. */
+	memset(&msgflags, 0, IMAP_NFLAGS * sizeof(int));
 	if (flags) {
 		int i, j;
 
-		memset(&msgflags, 0, IMAP_NFLAGS * sizeof(int));
-
 		for (i = 0; flags[i]; i++) { // Loop through all script/user-specified flags.
 			for (j = 0; imap_flag_desc[j]; i++) { // Find the ones we support.
 				if (g_strcasestr(imap_flag_desc[j], flags[i])) {
@@ -684,8 +683,10 @@
 void sort_free_result(sort_result_t *result)
 {
 	if (result == NULL) return;
-	g_string_free(result->errormsg, TRUE);
-	g_string_free(result->rejectmsg, TRUE);
+	if (result->errormsg != NULL) 
+		g_string_free(result->errormsg, TRUE);
+	if (result->rejectmsg != NULL) 
+		g_string_free(result->rejectmsg, TRUE);
 	dm_free(result);
 }
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2211)
+++ ChangeLog	(revision 2212)
@@ -1,3 +1,9 @@
+2006-07-26  Aaron Stone  <aaron@serendipity.cx>
+
+	* modules/sortsieve.c:
+	Accepted patch from maenaka (closes bug #383) to clear the IMAP flags
+	if none are given by the Sieve script.
+
 2006-07-25  Paul J Stevens <paul@nfg.nl>
 
 	* misc.c: