dovecot-1.1: master: make sure we don't access freed memory on d...

dovecot at dovecot.org dovecot at dovecot.org
Tue Feb 10 02:58:56 EET 2009


details:   http://hg.dovecot.org/dovecot-1.1/rev/a91b2f52d453
changeset: 8158:a91b2f52d453
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Feb 09 19:58:50 2009 -0500
description:
master: make sure we don't access freed memory on deinit.

diffstat:

2 files changed, 5 insertions(+), 11 deletions(-)
src/master/dict-process.c |    3 ++-
src/master/mail-process.c |   13 +++----------

diffs (35 lines):

diff -r bdc5391e52df -r a91b2f52d453 src/master/dict-process.c
--- a/src/master/dict-process.c	Mon Feb 09 19:43:49 2009 -0500
+++ b/src/master/dict-process.c	Mon Feb 09 19:58:50 2009 -0500
@@ -202,7 +202,8 @@ void dict_process_deinit(void)
 	if (process->log != NULL)
 		log_unref(process->log);
 	i_free(process->path);
-	i_free(process);
+	/* don't free() the process. it's still referenced in child-processes
+	   and we may want to look it up. This deinit code needs a redesign.. */
 }
 
 void dict_process_kill(void)
diff -r bdc5391e52df -r a91b2f52d453 src/master/mail-process.c
--- a/src/master/mail-process.c	Mon Feb 09 19:43:49 2009 -0500
+++ b/src/master/mail-process.c	Mon Feb 09 19:58:50 2009 -0500
@@ -926,15 +926,8 @@ void mail_processes_init(void)
 
 void mail_processes_deinit(void)
 {
-	struct hash_iterate_context *iter;
-	void *key, *value;
-
-	iter = hash_iterate_init(mail_process_groups);
-	while (hash_iterate(iter, &key, &value)) {
-		struct mail_process_group *group = value;
-		mail_process_group_free(group);
-	}
-	hash_iterate_deinit(&iter);
-
+	/* don't free() the mail process groups. child_process structs are
+	   still referenced in child-processes and we may need to look them up.
+	   This deinit code needs a redesign.. */
 	hash_destroy(&mail_process_groups);
 }


More information about the dovecot-cvs mailing list