dovecot-1.1: Memory leak fixes.

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 27 08:10:58 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/6bd90d2c8331
changeset: 7716:6bd90d2c8331
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 27 08:10:48 2008 +0300
description:
Memory leak fixes.

diffstat:

2 files changed, 10 insertions(+), 2 deletions(-)
src/lib-storage/index/index-sort-string.c |    9 +++++++--
src/lib-storage/index/index-sort.c        |    3 +++

diffs (36 lines):

diff -r c12eba9eb5a1 -r 6bd90d2c8331 src/lib-storage/index/index-sort-string.c
--- a/src/lib-storage/index/index-sort-string.c	Thu Jun 26 21:37:31 2008 +0300
+++ b/src/lib-storage/index/index-sort-string.c	Fri Jun 27 08:10:48 2008 +0300
@@ -753,7 +753,10 @@ void index_sort_list_finish_string(struc
 		qsort(nodes, count, sizeof(struct mail_sort_node),
 		      sort_node_cmp);
 
-		i_array_init(&program->seqs, count);
+		if (!array_is_created(&program->seqs))
+			i_array_init(&program->seqs, count);
+		else
+			array_clear(&program->seqs);
 		for (i = 0; i < count; i++) {
 			seq = nodes[i].seq;
 			array_append(&program->seqs, &seq, 1);
@@ -818,4 +821,6 @@ void index_sort_list_finish_string(struc
 	}
 
 	array_free(&ctx->zero_nodes);
-}
+	i_free(ctx);
+	program->context = NULL;
+}
diff -r c12eba9eb5a1 -r 6bd90d2c8331 src/lib-storage/index/index-sort.c
--- a/src/lib-storage/index/index-sort.c	Thu Jun 26 21:37:31 2008 +0300
+++ b/src/lib-storage/index/index-sort.c	Fri Jun 27 08:10:48 2008 +0300
@@ -235,6 +235,9 @@ void index_sort_program_deinit(struct ma
 	struct mail_search_sort_program *program = *_program;
 
 	*_program = NULL;
+
+	if (program->context != NULL)
+		index_sort_list_finish(program);
 	mail_free(&program->temp_mail);
 	array_free(&program->seqs);
 	i_free(program);


More information about the dovecot-cvs mailing list