diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-12-15 08:23:00 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-12-15 08:23:00 +0000 |
commit | 9e49ecbddd34b13c5319171229623916a86d0a23 (patch) | |
tree | 688f10341cbf21ce4942dc29a07903dcfbe68f8a /src | |
parent | 252f641b0b8b80f80973358d082f1d1aa1418b28 (diff) | |
download | rspamd-9e49ecbddd34b13c5319171229623916a86d0a23.tar.gz rspamd-9e49ecbddd34b13c5319171229623916a86d0a23.zip |
[Minor] Set pointer to NULL after usage to avoid confusion
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/mime_headers.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index 2c92e4e4e..0564379e4 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -202,8 +202,7 @@ rspamd_mime_headers_process (struct rspamd_task *task, GHashTable *target, case 1: /* We got something like header's name */ if (*p == ':') { - nh = - rspamd_mempool_alloc0 (task->task_pool, + nh = rspamd_mempool_alloc0 (task->task_pool, sizeof (struct rspamd_mime_header)); l = p - c; tmp = rspamd_mempool_alloc (task->task_pool, l + 1); @@ -357,8 +356,9 @@ rspamd_mime_headers_process (struct rspamd_task *task, GHashTable *target, /* We also validate utf8 and replace all non-valid utf8 chars */ rspamd_mime_charset_utf_enforce (nh->decoded, strlen (nh->decoded)); - rspamd_mime_header_add (task, target, order, nh, check_newlines); nh->order = norder ++; + rspamd_mime_header_add (task, target, order, nh, check_newlines); + nh = NULL; state = 0; break; case 5: @@ -368,6 +368,7 @@ rspamd_mime_headers_process (struct rspamd_task *task, GHashTable *target, nh->raw_len = p - nh->raw_value; nh->order = norder ++; rspamd_mime_header_add (task, target, order, nh, check_newlines); + nh = NULL; state = 0; break; case 99: |