]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Memory allocation tweaks.
authorTimo Sirainen <tss@iki.fi>
Wed, 28 Oct 2009 21:02:01 +0000 (17:02 -0400)
committerTimo Sirainen <tss@iki.fi>
Wed, 28 Oct 2009 21:02:01 +0000 (17:02 -0400)
--HG--
branch : HEAD

src/dsync/dsync-proxy-server-cmd.c
src/dsync/dsync-proxy-server.c
src/dsync/dsync-worker.c
src/lib-storage/index/index-storage.c

index debb1279e266a5dda596639b11a77514774118ec..a3804960352df078c11bc8018e427d587f550cc6 100644 (file)
@@ -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;
                }
index 069b2f629b10845215b100405b206c1632c4a037..4247597db986590f696efce4273b5c4411f81b82 100644 (file)
@@ -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,
index 42292bedca9ef511fc8634cc99f662804beea2fb..d9fed35e72e49d63203051b675f938cff7c4f550 100644 (file)
@@ -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,
index ff205fac5dc4157db8e401f451bf8e327abadd45..13464b85c781b43a1b8825e4ff8a78805a38ed67 100644 (file)
@@ -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;
 }