dovecot: Crashfix

dovecot at dovecot.org dovecot at dovecot.org
Tue Aug 7 01:33:08 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/9d77a7d26f28
changeset: 6200:9d77a7d26f28
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 07 01:24:59 2007 +0300
description:
Crashfix

diffstat:

1 file changed, 10 insertions(+), 6 deletions(-)
src/plugins/quota/quota.c |   16 ++++++++++------

diffs (39 lines):

diff -r c1d09af8bdda -r 9d77a7d26f28 src/plugins/quota/quota.c
--- a/src/plugins/quota/quota.c	Tue Aug 07 01:00:12 2007 +0300
+++ b/src/plugins/quota/quota.c	Tue Aug 07 01:24:59 2007 +0300
@@ -56,12 +56,13 @@ void quota_deinit(struct quota **_quota)
 void quota_deinit(struct quota **_quota)
 {
 	struct quota *quota = *_quota;
-	struct quota_root **root;
+	struct quota_root **root_p, *root;
 
 	*_quota = NULL;
 	while (array_count(&quota->roots) > 0) {
-		root = array_idx_modifiable(&quota->roots, 0);
-		quota_root_deinit(root);
+		root_p = array_idx_modifiable(&quota->roots, 0);
+		root = *root_p;
+		quota_root_deinit(&root);
 	}
 
 	array_free(&quota->roots);
@@ -148,12 +149,15 @@ void quota_root_deinit(struct quota_root
 	struct quota_warning_rule *warnings;
 	unsigned int i, count;
 
+	*_root = NULL;
+
 	roots = array_get(&root->quota->roots, &count);
 	for (i = 0; i < count; i++) {
-		if (roots[i] == root)
+		if (roots[i] == root) {
 			array_delete(&root->quota->roots, i, 1);
-	}
-	*_root = NULL;
+			break;
+		}
+	}
 
 	warnings = array_get_modifiable(&root->warning_rules, &count);
 	for (i = 0; i < count; i++)


More information about the dovecot-cvs mailing list