diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-06-11 17:00:30 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-06-11 17:00:30 +0400 |
commit | c4aab3053d2839e6d3b99f8a542b0a4f54f2b856 (patch) | |
tree | 852f6c9afe65aadafad2176e7acd4e4ac4c07c81 /src/smtp_proto.c | |
parent | 07082741605e8e048a129bec28695f57263de1e8 (diff) | |
download | rspamd-c4aab3053d2839e6d3b99f8a542b0a4f54f2b856.tar.gz rspamd-c4aab3053d2839e6d3b99f8a542b0a4f54f2b856.zip |
* Fix SMTP
Diffstat (limited to 'src/smtp_proto.c')
-rw-r--r-- | src/smtp_proto.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/smtp_proto.c b/src/smtp_proto.c index bef52b6b5..0eef4ec17 100644 --- a/src/smtp_proto.c +++ b/src/smtp_proto.c @@ -390,7 +390,7 @@ gboolean smtp_upstream_read_socket (f_str_t * in, void *arg) { struct smtp_session *session = arg; - char outbuf[BUFSIZ], *tmppattern; + char outbuf[BUFSIZ]; int r; switch (session->upstream_state) { @@ -551,9 +551,9 @@ smtp_upstream_read_socket (f_str_t * in, void *arg) } else if (r == 1) { r = strlen (session->cfg->temp_dir) + sizeof ("/rspamd-XXXXXX.tmp"); - tmppattern = alloca (r); - snprintf (tmppattern, r, "%s/rspamd-XXXXXX.tmp", session->cfg->temp_dir); - session->temp_fd = g_mkstemp_full (tmppattern, O_RDWR, S_IWUSR | S_IRUSR); + session->temp_name = memory_pool_alloc (session->pool, r); + snprintf (session->temp_name, r, "%s%crspamd-XXXXXX.tmp", session->cfg->temp_dir, G_DIR_SEPARATOR); + session->temp_fd = g_mkstemp_full (session->temp_name, O_RDWR, S_IWUSR | S_IRUSR); if (session->temp_fd == -1) { session->error = SMTP_ERROR_FILE; session->state = SMTP_STATE_CRITICAL_ERROR; |