summaryrefslogtreecommitdiffstats
path: root/src/libmime/scan_result.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-06 17:09:18 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-06 18:23:44 +0100
commitd916f02050c63045ec7eb6e238dd281337e804c5 (patch)
treee8983aa74ee268a1569733079d2f459a3ae9dbbb /src/libmime/scan_result.c
parenteaef907b98ae5ceb72ef2806211ce433704a2fc6 (diff)
downloadrspamd-d916f02050c63045ec7eb6e238dd281337e804c5.tar.gz
rspamd-d916f02050c63045ec7eb6e238dd281337e804c5.zip
[Minor] Allow to add named results via lua API
Diffstat (limited to 'src/libmime/scan_result.c')
-rw-r--r--src/libmime/scan_result.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libmime/scan_result.c b/src/libmime/scan_result.c
index 44c481e67..a27c3b0b2 100644
--- a/src/libmime/scan_result.c
+++ b/src/libmime/scan_result.c
@@ -67,7 +67,14 @@ rspamd_create_metric_result (struct rspamd_task *task,
sizeof (struct rspamd_scan_result));
metric_res->symbols = kh_init (rspamd_symbols_hash);
metric_res->sym_groups = kh_init (rspamd_symbols_group_hash);
- metric_res->name = name;
+
+ if (name) {
+ metric_res->name = rspamd_mempool_strdup (task->task_pool, name);
+ }
+ else {
+ metric_res->name = NULL;
+ }
+
metric_res->symbol_cbref = lua_sym_cbref;
metric_res->task = task;