Mercurial > dovecot > core-2.2
changeset 16503:5ed2f41431c4
Memory leak fixes.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 13 Jun 2013 03:26:22 +0300 |
parents | 235be95cb378 |
children | d8fc9bba98ab |
files | src/doveadm/client-connection.c src/doveadm/dsync/dsync-brain-mailbox.c src/doveadm/dsync/dsync-brain.c src/doveadm/dsync/dsync-ibc-pipe.c src/doveadm/dsync/dsync-mailbox-export.c src/doveadm/main.c src/lib-fs/fs-api.c |
diffstat | 7 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/client-connection.c Wed Jun 12 23:01:26 2013 +0300 +++ b/src/doveadm/client-connection.c Thu Jun 13 03:26:22 2013 +0300 @@ -74,6 +74,7 @@ "Client sent unknown parameter: %c", cmd->name, c); ctx->v.deinit(ctx); + pool_unref(&ctx->pool); return NULL; } } @@ -86,6 +87,7 @@ i_error("doveadm %s: Client sent unknown parameter: %s", cmd->name, argv[0]); ctx->v.deinit(ctx); + pool_unref(&ctx->pool); return NULL; } ctx->args = (const void *)argv;
--- a/src/doveadm/dsync/dsync-brain-mailbox.c Wed Jun 12 23:01:26 2013 +0300 +++ b/src/doveadm/dsync/dsync-brain-mailbox.c Thu Jun 13 03:26:22 2013 +0300 @@ -197,6 +197,7 @@ uint64_t last_common_modseq, last_common_pvt_modseq; i_assert(brain->log_scan == NULL); + i_assert(brain->box_exporter == NULL); last_common_uid = brain->mailbox_state.last_common_uid; last_common_modseq = brain->mailbox_state.last_common_modseq;
--- a/src/doveadm/dsync/dsync-brain.c Wed Jun 12 23:01:26 2013 +0300 +++ b/src/doveadm/dsync/dsync-brain.c Thu Jun 13 03:26:22 2013 +0300 @@ -186,6 +186,8 @@ dsync_brain_sync_mailbox_deinit(brain); if (brain->local_tree_iter != NULL) dsync_mailbox_tree_iter_deinit(&brain->local_tree_iter); + dsync_mailbox_tree_deinit(&brain->local_mailbox_tree); + dsync_mailbox_tree_deinit(&brain->remote_mailbox_tree); if (brain->mailbox_states_iter != NULL) hash_table_iterate_deinit(&brain->mailbox_states_iter); hash_table_destroy(&brain->mailbox_states);
--- a/src/doveadm/dsync/dsync-ibc-pipe.c Wed Jun 12 23:01:26 2013 +0300 +++ b/src/doveadm/dsync/dsync-ibc-pipe.c Thu Jun 13 03:26:22 2013 +0300 @@ -134,6 +134,7 @@ static void dsync_ibc_pipe_deinit(struct dsync_ibc *ibc) { struct dsync_ibc_pipe *pipe = (struct dsync_ibc_pipe *)ibc; + struct item *item; pool_t *poolp; if (pipe->remote != NULL) { @@ -143,6 +144,10 @@ if (pipe->pop_pool != NULL) pool_unref(&pipe->pop_pool); + array_foreach_modifiable(&pipe->item_queue, item) { + if (item->pool != NULL) + pool_unref(&item->pool); + } array_foreach_modifiable(&pipe->pools, poolp) pool_unref(poolp); array_free(&pipe->pools);
--- a/src/doveadm/dsync/dsync-mailbox-export.c Wed Jun 12 23:01:26 2013 +0300 +++ b/src/doveadm/dsync/dsync-mailbox-export.c Thu Jun 13 03:26:22 2013 +0300 @@ -844,6 +844,7 @@ if (exporter->attr.value_stream != NULL) i_stream_unref(&exporter->attr.value_stream); hash_table_destroy(&exporter->export_guids); + hash_table_destroy(&exporter->changes); *error_r = t_strdup(exporter->error); pool_unref(&exporter->pool);
--- a/src/doveadm/main.c Wed Jun 12 23:01:26 2013 +0300 +++ b/src/doveadm/main.c Thu Jun 13 03:26:22 2013 +0300 @@ -61,6 +61,7 @@ client_connection_destroy(&doveadm_client); doveadm_mail_deinit(); doveadm_unload_modules(); + doveadm_print_deinit(); } int main(int argc, char *argv[])
--- a/src/lib-fs/fs-api.c Wed Jun 12 23:01:26 2013 +0300 +++ b/src/lib-fs/fs-api.c Thu Jun 13 03:26:22 2013 +0300 @@ -43,6 +43,11 @@ array_append(&fs_classes, &fs_class, 1); } +static void fs_classes_deinit(void) +{ + array_free(&fs_classes); +} + static void fs_classes_init(void) { i_array_init(&fs_classes, 8); @@ -50,6 +55,7 @@ fs_class_register(&fs_class_metawrap); fs_class_register(&fs_class_sis); fs_class_register(&fs_class_sis_queue); + lib_atexit(fs_classes_deinit); } static const struct fs *fs_class_find(const char *driver)