aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-27 22:18:04 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-27 22:18:04 +0000
commit0173df4e08a31df6cdf95354cafd17373447aba2 (patch)
treeb63ec94b74985c4453f2357a07306b5381c818df
parent8e5c6a75076f26b9e0b0b0d8200f3c323d15a764 (diff)
downloadrspamd-0173df4e08a31df6cdf95354cafd17373447aba2.tar.gz
rspamd-0173df4e08a31df6cdf95354cafd17373447aba2.zip
Fix initialization order.
-rw-r--r--src/libstat/stat_process.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 9795b81fa..2b1fd629c 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -80,6 +80,7 @@ preprocess_init_stat_token (gpointer k, gpointer v, gpointer d)
t->results = g_array_sized_new (FALSE, TRUE,
sizeof (struct rspamd_token_result), cbdata->results_count);
+ g_array_set_size (t->results, cbdata->results_count);
cur = g_list_first (cbdata->classifier_runtimes);
@@ -97,14 +98,13 @@ preprocess_init_stat_token (gpointer k, gpointer v, gpointer d)
continue;
}
- res = &g_array_index (t->results, struct rspamd_token_result, i);
-
curst = cl_runtime->st_runtime;
- res->cl_runtime = cl_runtime;
while (curst) {
- st_runtime = (struct rspamd_statfile_runtime *)curst->data;
+ st_runtime = (struct rspamd_statfile_runtime *)curst->data;
+ res = &g_array_index (t->results, struct rspamd_token_result, i);
+ res->cl_runtime = cl_runtime;
res->st_runtime = st_runtime;
if (st_runtime->backend->process_token (t, res,