]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix options insertion
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Dec 2019 19:04:47 +0000 (19:04 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Dec 2019 19:04:47 +0000 (19:04 +0000)
src/libmime/scan_result.c

index 5ded3ac57ab771374242c3d3292cd04467ee5095..7a8451f9c907006c5a0d50db7af436c3bedfc9ee 100644 (file)
@@ -290,19 +290,9 @@ insert_metric_result (struct rspamd_task *task,
                        single = TRUE;
                }
 
-               /* Now check for the duplicate options */
-               if (opt && s->options) {
-                       k = kh_get (rspamd_options_hash, s->options, opt);
+               s->nshots ++;
 
-                       if (k == kh_end (s->options)) {
-                               rspamd_task_add_result_option (task, s, opt);
-                       }
-                       else {
-                               s->nshots ++;
-                       }
-               }
-               else {
-                       s->nshots ++;
+               if (opt) {
                        rspamd_task_add_result_option (task, s, opt);
                }
 
@@ -573,19 +563,8 @@ rspamd_task_add_result_option (struct rspamd_task *task,
                        }
                }
                else {
-                       opt = rspamd_mempool_alloc0 (task->task_pool, sizeof (*opt));
-
-                       if (opt_cpy == NULL) {
-                               opt_cpy = rspamd_mempool_strdup (task->task_pool, val);
-                       }
-
-                       k = kh_put (rspamd_options_hash, s->options, opt_cpy, &r);
-
-                       kh_value (s->options, k) = opt;
-                       opt->option = opt_cpy;
-                       DL_APPEND (s->opts_head, opt);
-
-                       ret = TRUE;
+                       /* Skip addition */
+                       ret = FALSE;
                }
 
                if (ret && s->opts_len >= 0) {