dovecot-2.0-sslstream: Memory allocation tweaks.
dovecot at dovecot.org
dovecot at dovecot.org
Sat Feb 13 02:55:50 EET 2010
details: http://hg.dovecot.org/dovecot-2.0-sslstream/rev/eb9a262fde74
changeset: 10219:eb9a262fde74
user: Timo Sirainen <tss at iki.fi>
date: Wed Oct 28 17:02:01 2009 -0400
description:
Memory allocation tweaks.
diffstat:
4 files changed, 15 insertions(+), 6 deletions(-)
src/dsync/dsync-proxy-server-cmd.c | 9 +++++++--
src/dsync/dsync-proxy-server.c | 4 ++--
src/dsync/dsync-worker.c | 4 +++-
src/lib-storage/index/index-storage.c | 4 +++-
diffs (72 lines):
diff -r a553595ce5a9 -r eb9a262fde74 src/dsync/dsync-proxy-server-cmd.c
--- a/src/dsync/dsync-proxy-server-cmd.c Wed Oct 28 16:12:06 2009 -0400
+++ b/src/dsync/dsync-proxy-server-cmd.c Wed Oct 28 17:02:01 2009 -0400
@@ -65,12 +65,17 @@ cmd_msg_list_init(struct dsync_proxy_ser
{
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 -r a553595ce5a9 -r eb9a262fde74 src/dsync/dsync-proxy-server.c
--- a/src/dsync/dsync-proxy-server.c Wed Oct 28 16:12:06 2009 -0400
+++ b/src/dsync/dsync-proxy-server.c Wed Oct 28 17:02:01 2009 -0400
@@ -57,7 +57,8 @@ proxy_server_input_line(struct dsync_pro
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_pro
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 -r a553595ce5a9 -r eb9a262fde74 src/dsync/dsync-worker.c
--- a/src/dsync/dsync-worker.c Wed Oct 28 16:12:06 2009 -0400
+++ b/src/dsync/dsync-worker.c Wed Oct 28 17:02:01 2009 -0400
@@ -107,7 +107,9 @@ void dsync_worker_update_mailbox(struct
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 -r a553595ce5a9 -r eb9a262fde74 src/lib-storage/index/index-storage.c
--- a/src/lib-storage/index/index-storage.c Wed Oct 28 16:12:06 2009 -0400
+++ b/src/lib-storage/index/index-storage.c Wed Oct 28 17:02:01 2009 -0400
@@ -512,7 +512,9 @@ int index_storage_mailbox_enable(struct
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;
}
More information about the dovecot-cvs
mailing list