Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7956:439636cce455 HEAD
Memory leak fixes.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 27 Jun 2008 08:10:54 +0300 |
parents | 83019368c9dc |
children | 22244e559776 |
files | src/imap/cmd-fetch.c src/imap/imap-fetch.c src/lib-index/mail-index-modseq.c src/lib-storage/index/index-sort-string.c src/lib-storage/index/index-sort.c |
diffstat | 5 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/imap/cmd-fetch.c Thu Jun 26 21:37:31 2008 +0300 +++ b/src/imap/cmd-fetch.c Fri Jun 27 08:10:54 2008 +0300 @@ -201,8 +201,10 @@ return ret < 0; ctx = imap_fetch_init(cmd, client->mailbox); - if (ctx == NULL) + if (ctx == NULL) { + mail_search_args_unref(&search_args); return TRUE; + } ctx->search_args = search_args; if (!fetch_parse_args(ctx, &args[1]) ||
--- a/src/imap/imap-fetch.c Thu Jun 26 21:37:31 2008 +0300 +++ b/src/imap/imap-fetch.c Fri Jun 27 08:10:54 2008 +0300 @@ -562,6 +562,7 @@ if (ctx->mail != NULL) mail_free(&ctx->mail); + mail_search_args_unref(&ctx->search_args); if (ctx->search_ctx != NULL) { if (mailbox_search_deinit(&ctx->search_ctx) < 0) ctx->failed = TRUE;
--- a/src/lib-index/mail-index-modseq.c Thu Jun 26 21:37:31 2008 +0300 +++ b/src/lib-index/mail-index-modseq.c Fri Jun 27 08:10:54 2008 +0300 @@ -608,8 +608,8 @@ metadata = array_get_modifiable(&mmap->metadata_modseqs, &count); for (i = 0; i < count; i++) { - if (array_is_created(&metadata->modseqs)) - array_free(&metadata->modseqs); + if (array_is_created(&metadata[i].modseqs)) + array_free(&metadata[i].modseqs); } array_free(&mmap->metadata_modseqs); i_free(mmap);
--- 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:54 2008 +0300 @@ -753,7 +753,10 @@ 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 @@ } array_free(&ctx->zero_nodes); + i_free(ctx); + program->context = NULL; }
--- 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:54 2008 +0300 @@ -235,6 +235,9 @@ 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);