dovecot: Added t_push/t_pops to avoid wasting memory.

dovecot at dovecot.org dovecot at dovecot.org
Wed Jul 18 06:17:52 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/f42deb78f0e7
changeset: 6061:f42deb78f0e7
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jul 18 04:17:13 2007 +0300
description:
Added t_push/t_pops to avoid wasting memory.

diffstat:

2 files changed, 5 insertions(+)
src/imap/imap-status.c                          |    2 ++
src/lib-storage/index/maildir/maildir-storage.c |    3 +++

diffs (44 lines):

diff -r f88fed67bca9 -r f42deb78f0e7 src/imap/imap-status.c
--- a/src/imap/imap-status.c	Wed Jul 18 04:04:49 2007 +0300
+++ b/src/imap/imap-status.c	Wed Jul 18 04:17:13 2007 +0300
@@ -82,6 +82,7 @@ void imap_status_send(struct client *cli
 {
 	string_t *str;
 
+	t_push();
 	str = t_str_new(128);
 	str_append(str, "* STATUS ");
         imap_quote_append_string(str, mailbox, FALSE);
@@ -103,4 +104,5 @@ void imap_status_send(struct client *cli
 	str_append_c(str, ')');
 
 	client_send_line(client, str_c(str));
+	t_pop();
 }
diff -r f88fed67bca9 -r f42deb78f0e7 src/lib-storage/index/maildir/maildir-storage.c
--- a/src/lib-storage/index/maildir/maildir-storage.c	Wed Jul 18 04:04:49 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-storage.c	Wed Jul 18 04:17:13 2007 +0300
@@ -431,6 +431,7 @@ maildir_open(struct maildir_storage *sto
 	int shared;
 	pool_t pool;
 
+	t_push();
 	path = mailbox_list_get_path(storage->storage.list, name,
 				     MAILBOX_LIST_PATH_TYPE_MAILBOX);
 	control_dir = mailbox_list_get_path(storage->storage.list, name,
@@ -478,6 +479,7 @@ maildir_open(struct maildir_storage *sto
 			struct mailbox *box = &mbox->ibox.box;
 
 			mailbox_close(&box);
+			t_pop();
 			return NULL;
 		}
 		mbox->keep_lock_to = timeout_add(MAILDIR_LOCK_TOUCH_SECS * 1000,
@@ -490,6 +492,7 @@ maildir_open(struct maildir_storage *sto
 	if (access(t_strconcat(path, "/cur", NULL), W_OK) < 0 &&
 	    errno == EACCES)
 		mbox->ibox.readonly = TRUE;
+	t_pop();
 	return &mbox->ibox.box;
 }
 


More information about the dovecot-cvs mailing list