From: Timo Sirainen Date: Wed, 28 Oct 2009 21:02:01 +0000 (-0400) Subject: Memory allocation tweaks. X-Git-Tag: 2.0.alpha3~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0110438983cbc6bd093a5c35d14e9c6402329c6;p=thirdparty%2Fdovecot%2Fcore.git Memory allocation tweaks. --HG-- branch : HEAD --- diff --git a/src/dsync/dsync-proxy-server-cmd.c b/src/dsync/dsync-proxy-server-cmd.c index debb1279e2..a380496035 100644 --- a/src/dsync/dsync-proxy-server-cmd.c +++ b/src/dsync/dsync-proxy-server-cmd.c @@ -65,12 +65,17 @@ cmd_msg_list_init(struct dsync_proxy_server *server, const char *const *args) { mailbox_guid_t *mailboxes; unsigned int i, count; + int ret; count = str_array_length(args); mailboxes = count == 0 ? NULL : t_new(mailbox_guid_t, count); for (i = 0; i < count; i++) { - if (dsync_proxy_mailbox_guid_import(args[i], - &mailboxes[i]) < 0) { + T_BEGIN { + ret = dsync_proxy_mailbox_guid_import(args[i], + &mailboxes[i]); + } T_END; + + if (ret < 0) { i_error("msg-list: Invalid mailbox GUID '%s'", args[i]); return -1; } diff --git a/src/dsync/dsync-proxy-server.c b/src/dsync/dsync-proxy-server.c index 069b2f629b..4247597db9 100644 --- a/src/dsync/dsync-proxy-server.c +++ b/src/dsync/dsync-proxy-server.c @@ -57,7 +57,8 @@ proxy_server_input_line(struct dsync_proxy_server *server, const char *line) i_assert(server->cur_cmd == NULL); - args = t_strsplit(line, "\t"); + p_clear(server->cmd_pool); + args = (const char *const *)p_strsplit(server->cmd_pool, line, "\t"); if (args[0] == NULL) { i_error("proxy client sent invalid input: %s", line); return -1; @@ -71,7 +72,6 @@ proxy_server_input_line(struct dsync_proxy_server *server, const char *line) args++; count = str_array_length(args); - p_clear(server->cmd_pool); cmd_args = p_new(server->cmd_pool, const char *, count + 1); for (i = 0; i < count; i++) { cmd_args[i] = str_tabunescape(p_strdup(server->cmd_pool, diff --git a/src/dsync/dsync-worker.c b/src/dsync/dsync-worker.c index 42292bedca..d9fed35e72 100644 --- a/src/dsync/dsync-worker.c +++ b/src/dsync/dsync-worker.c @@ -107,7 +107,9 @@ void dsync_worker_rename_mailbox(struct dsync_worker *worker, void dsync_worker_update_mailbox(struct dsync_worker *worker, const struct dsync_mailbox *dsync_box) { - worker->v.update_mailbox(worker, dsync_box); + T_BEGIN { + worker->v.update_mailbox(worker, dsync_box); + } T_END; } void dsync_worker_select_mailbox(struct dsync_worker *worker, diff --git a/src/lib-storage/index/index-storage.c b/src/lib-storage/index/index-storage.c index ff205fac5d..13464b85c7 100644 --- a/src/lib-storage/index/index-storage.c +++ b/src/lib-storage/index/index-storage.c @@ -512,7 +512,9 @@ int index_storage_mailbox_enable(struct mailbox *box, if (mailbox_open(box) < 0) return -1; } - mail_index_modseq_enable(ibox->index); + T_BEGIN { + mail_index_modseq_enable(ibox->index); + } T_END; } return 0; }