]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Plug memory leak
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 29 Aug 2020 13:19:57 +0000 (14:19 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 29 Aug 2020 13:19:57 +0000 (14:19 +0100)
src/libmime/mime_headers.c

index 6e26c1890e75a2028225bbab747ae397b7cba72f..58e1b7ca05dc275f80965aea2143822a8707c814 100644 (file)
@@ -1625,11 +1625,13 @@ rspamd_smtp_received_parse (struct rspamd_task *task,
                case RSPAMD_RECEIVED_PART_FOR:
                        rh->for_addr = rspamd_email_address_from_smtp (cur->data, cur->dlen);
 
-                       if (rh->for_addr && rh->for_addr->addr_len > 0) {
-                               t1.begin = rh->for_addr->addr;
-                               t1.len = rh->for_addr->addr_len;
-                               rh->for_mbox = rspamd_mempool_ftokdup (task->task_pool,
-                                               &t1);
+                       if (rh->for_addr) {
+                               if (rh->for_addr->addr_len > 0) {
+                                       t1.begin = rh->for_addr->addr;
+                                       t1.len = rh->for_addr->addr_len;
+                                       rh->for_mbox = rspamd_mempool_ftokdup (task->task_pool,
+                                                       &t1);
+                               }
 
                                rspamd_mempool_add_destructor (task->task_pool,
                                                (rspamd_mempool_destruct_t)rspamd_email_address_free,