dovecot-2.1: lib-master: Fixed crashes with settings cache.

dovecot at dovecot.org dovecot at dovecot.org
Tue Oct 2 23:12:14 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/e29b627219b3
changeset: 14744:e29b627219b3
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Oct 02 23:12:07 2012 +0300
description:
lib-master: Fixed crashes with settings cache.

diffstat:

 src/lib-master/master-service-settings-cache.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 94c7e875f9b9 -r e29b627219b3 src/lib-master/master-service-settings-cache.c
--- a/src/lib-master/master-service-settings-cache.c	Tue Oct 02 22:37:49 2012 +0300
+++ b/src/lib-master/master-service-settings-cache.c	Tue Oct 02 23:12:07 2012 +0300
@@ -83,6 +83,7 @@
 	}
 	for (entry = cache->oldest; entry != NULL; entry = next) {
 		next = entry->next;
+		i_assert(entry->parser != cache->global_parser);
 		settings_parser_deinit(&entry->parser);
 		pool_unref(&entry->pool);
 	}
@@ -146,8 +147,10 @@
 	}
 
 	if (entry != NULL) {
-		DLLIST2_REMOVE(&cache->oldest, &cache->newest, entry);
-		DLLIST2_APPEND(&cache->oldest, &cache->newest, entry);
+		if (entry->parser != cache->global_parser) {
+			DLLIST2_REMOVE(&cache->oldest, &cache->newest, entry);
+			DLLIST2_APPEND(&cache->oldest, &cache->newest, entry);
+		}
 		*parser_r = entry->parser;
 		return TRUE;
 	}


More information about the dovecot-cvs mailing list