new_task->flags |= RSPAMD_TASK_FLAG_PASS_ALL;
}
- new_task->re_rt = rspamd_re_cache_runtime_new (cfg->re_cache);
+
+ if (cfg->re_cache) {
+ new_task->re_rt = rspamd_re_cache_runtime_new (cfg->re_cache);
+ }
if (new_task->lang_det == NULL && cfg->lang_det != NULL) {
new_task->lang_det = cfg->lang_det;
if (fname) {
if (lua_type (L, 2) == LUA_TUSERDATA) {
- cfg = rspamd_lua_check_udata_maybe (L, 2, "rspamd{config}");
+ gpointer p;
+ p = rspamd_lua_check_udata_maybe (L, 2, "rspamd{config}");
+
+ if (p) {
+ cfg = *(struct rspamd_config **)p;
+ }
}
map = rspamd_file_xmap (fname, PROT_READ, &sz, TRUE);