From: Timo Sirainen Date: Thu, 24 Feb 2011 09:26:27 +0000 (+0200) Subject: Avoid unnecessary data stack leaks. X-Git-Tag: 2.1.alpha1~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2470b3dfe91ca07459185384ee25080b42a1636;p=thirdparty%2Fdovecot%2Fcore.git Avoid unnecessary data stack leaks. --- diff --git a/src/imap/imap-sync.c b/src/imap/imap-sync.c index 1c93ee4cc0..ad1edb7eac 100644 --- a/src/imap/imap-sync.c +++ b/src/imap/imap-sync.c @@ -680,7 +680,7 @@ static bool cmd_sync_drop_fast(struct client *client) return ret; } -bool cmd_sync_delayed(struct client *client) +static bool cmd_sync_delayed_real(struct client *client) { struct client_command_context *cmd, *first_expunge, *first_nonexpunge; @@ -726,3 +726,13 @@ bool cmd_sync_delayed(struct client *client) i_assert(client->mailbox != NULL); return cmd_sync_client(cmd); } + +bool cmd_sync_delayed(struct client *client) +{ + bool ret; + + T_BEGIN { + ret = cmd_sync_delayed_real(client); + } T_END; + return ret; +} diff --git a/src/lib-index/mail-index-transaction.c b/src/lib-index/mail-index-transaction.c index 95ed239f1f..a0d75c2a42 100644 --- a/src/lib-index/mail-index-transaction.c +++ b/src/lib-index/mail-index-transaction.c @@ -132,10 +132,10 @@ mail_index_transaction_commit_real(struct mail_index_transaction *t, if (mail_transaction_log_append_begin(log->index, external, &ctx) < 0) return -1; ret = mail_transaction_log_file_refresh(t, ctx); - if (ret > 0) { + if (ret > 0) T_BEGIN { mail_index_transaction_finish(t); mail_index_transaction_export(t, ctx); - } + } T_END; mail_transaction_log_get_head(log, &log_seq1, &log_offset1); if (mail_transaction_log_append_commit(&ctx) < 0 || ret < 0) diff --git a/src/lib/process-title.c b/src/lib/process-title.c index 5ccf34bfb5..7d75b04afe 100644 --- a/src/lib/process-title.c +++ b/src/lib/process-title.c @@ -137,7 +137,9 @@ void process_title_set(const char *title ATTR_UNUSED) else setproctitle("%s", title); #elif defined(PROCTITLE_HACK) - proctitle_hack_set(t_strconcat(process_name, " ", title, NULL)); + T_BEGIN { + proctitle_hack_set(t_strconcat(process_name, " ", title, NULL)); + } T_END; #endif }