diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-07 21:58:28 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-07 21:58:28 +0000 |
commit | 910d413d7bcf5b6ddacb7f9ead1f9f3fe2720522 (patch) | |
tree | d451f0a432d751e73d27b6b06d2a84acdf5bfd66 /src/libmime/mime_headers.c | |
parent | 841dbfe275d0863c272420ac718ea5f478552c4d (diff) | |
download | rspamd-910d413d7bcf5b6ddacb7f9ead1f9f3fe2720522.tar.gz rspamd-910d413d7bcf5b6ddacb7f9ead1f9f3fe2720522.zip |
[Minor] Fix memory issue
Diffstat (limited to 'src/libmime/mime_headers.c')
-rw-r--r-- | src/libmime/mime_headers.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index ca44c4765..a31b9ee01 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -1255,7 +1255,8 @@ rspamd_smtp_received_process_from_comment (struct rspamd_task *task, if (addr) { rh->addr = addr; - rh->real_ip = rspamd_inet_address_to_string (addr); + rh->real_ip = rspamd_mempool_strdup (task->task_pool, + rspamd_inet_address_to_string (addr)); rh->from_ip = rh->real_ip; } } @@ -1266,7 +1267,8 @@ rspamd_smtp_received_process_from_comment (struct rspamd_task *task, comment->dlen, task->task_pool); if (addr) { rh->addr = addr; - rh->real_ip = rspamd_inet_address_to_string (addr); + rh->real_ip = rspamd_mempool_strdup (task->task_pool, + rspamd_inet_address_to_string (addr)); rh->from_ip = rh->real_ip; } } @@ -1286,7 +1288,8 @@ rspamd_smtp_received_process_from_comment (struct rspamd_task *task, if (addr) { rh->addr = addr; - rh->real_ip = rspamd_inet_address_to_string (addr); + rh->real_ip = rspamd_mempool_strdup (task->task_pool, + rspamd_inet_address_to_string (addr)); rh->from_ip = rh->real_ip; /* Process with rDNS */ @@ -1349,7 +1352,8 @@ rspamd_smtp_received_process_from (struct rspamd_task *task, if (addr) { seen_ip_in_data = TRUE; rh->addr = addr; - rh->real_ip = rspamd_inet_address_to_string (addr); + rh->real_ip = rspamd_mempool_strdup (task->task_pool, + rspamd_inet_address_to_string (addr)); rh->from_ip = rh->real_ip; } } @@ -1361,7 +1365,8 @@ rspamd_smtp_received_process_from (struct rspamd_task *task, if (addr) { seen_ip_in_data = TRUE; rh->addr = addr; - rh->real_ip = rspamd_inet_address_to_string (addr); + rh->real_ip = rspamd_mempool_strdup (task->task_pool, + rspamd_inet_address_to_string (addr)); rh->from_ip = rh->real_ip; } } @@ -1443,8 +1448,8 @@ rspamd_smtp_received_parse (struct rspamd_task *task, continue; } else if (t1.len == t2.len + 2) { - if (t1.begin[t2.len - 1] == 's' && - t1.begin[t2.len] == 'a') { + if (t1.begin[t2.len] == 's' && + t1.begin[t2.len + 1] == 'a') { rh->type = RSPAMD_RECEIVED_ESMTPSA; rh->flags |= RSPAMD_RECEIVED_FLAG_AUTHENTICATED; rh->flags |= RSPAMD_RECEIVED_FLAG_SSL; |