aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Kaiser <skdovecot@smail.inf.fh-bonn-rhein-sieg.de>2008-03-05 14:10:14 +0100
committerJohannes Berg <johannes@sipsolutions.net>2008-03-05 14:10:14 +0100
commit7de9f5a9c1d62a944ca74e72013e226ee47b5cb4 (patch)
treeadbbfe152d5a55e375d5d896258ea66e6d9c1731
parent513d1c5fa703817ae8fd08fab86709a9b5c111e4 (diff)
downloaddovecot-antispam-7de9f5a9c1d62a944ca74e72013e226ee47b5cb4.tar.gz
dovecot-antispam-7de9f5a9c1d62a944ca74e72013e226ee47b5cb4.tar.xz
dovecot-antispam-7de9f5a9c1d62a944ca74e72013e226ee47b5cb4.zip
Leaked a t_pop() call in I/O handler 0x805b350
Raw backtrace: imap [0x80ad741] -> imap [0x80ad65c] -> imap(io_loop_handler _run+0x1ce) [0x80b35ce] -> imap(io_loop_run+0x28) [0x80b29a8] -> imap(main+0x5a0) [0x8063590] -> /lib/tls/i686/cmov/libc.so.6(__lib c_start_main+0xc8) [0xb7e37ea8] -> imap [0x8055e31] child 18478 (imap) killed with signal 6 Cause is, if sendmail fails with an exit code != 0, the function returns with -1 immediately skipping the t_pop() before the end of the function. This fixes it.
-rw-r--r--mailtrain.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mailtrain.c b/mailtrain.c
index cb571db..08f0534 100644
--- a/mailtrain.c
+++ b/mailtrain.c
@@ -125,6 +125,7 @@ static int process_tmpdir(struct mailbox_transaction_context *ctx,
int fd;
char *buf;
enum classification wanted;
+ int rc = 0;
t_push();
@@ -141,13 +142,15 @@ static int process_tmpdir(struct mailbox_transaction_context *ctx,
if (run_sendmail(fd, wanted)) {
mail_storage_set_error(ctx->box->storage,
"failed to send mail");
- return -1;
+ debug("run program failed with exit code %d\n", rc);
+ rc = -1;
+ break;
}
}
t_pop();
- return 0;
+ return rc;
}
static void clear_tmpdir(struct antispam_transaction_context *ast)