diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-06 10:39:20 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-06 10:39:20 +0100 |
commit | c55b683b92b311c9384f960b3a976bb288facac9 (patch) | |
tree | ff320397a72e51fe413ba7a9fc006672198d55e3 /src/libmime/received.cxx | |
parent | 4251918a1ab758f545bd1d5dc5e298016e1b6bca (diff) | |
download | rspamd-c55b683b92b311c9384f960b3a976bb288facac9.tar.gz rspamd-c55b683b92b311c9384f960b3a976bb288facac9.zip |
[Minor] Fix ownership issue
Diffstat (limited to 'src/libmime/received.cxx')
-rw-r--r-- | src/libmime/received.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/libmime/received.cxx b/src/libmime/received.cxx index 3dd972f91..550823a4d 100644 --- a/src/libmime/received.cxx +++ b/src/libmime/received.cxx @@ -629,15 +629,9 @@ received_header_parse(received_header_chain &chain, rspamd_mempool_t *pool, } break; case received_part_type::RSPAMD_RECEIVED_PART_FOR: - rh.for_addr = rspamd_email_address_from_smtp(part.data.data(), - part.data.size()); - - if (rh.for_addr) { - if (rh.for_addr->addr_len > 0) { - rh.for_mbox = std::string_view{rh.for_addr->addr, - rh.for_addr->addr_len}; - } - } + rh.for_mbox.assign_copy(part.data); + rh.for_addr = rspamd_email_address_from_smtp(rh.for_mbox.data(), + rh.for_mbox.size()); break; default: /* Do nothing */ |