diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-18 15:19:36 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-18 15:19:36 +0000 |
commit | ceb133b5e603c04cfa5c8da8851c8134523e0ee9 (patch) | |
tree | 631e1f166147a6a5bf3b6b1c50527f1514e2f4e3 /src/lua/lua_util.c | |
parent | b33f3fa4cfa42f1b92192ff18eb893b8bd93a1e9 (diff) | |
download | rspamd-ceb133b5e603c04cfa5c8da8851c8134523e0ee9.tar.gz rspamd-ceb133b5e603c04cfa5c8da8851c8134523e0ee9.zip |
Fix issues found
Diffstat (limited to 'src/lua/lua_util.c')
-rw-r--r-- | src/lua/lua_util.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c index f0c9369bf..6a43206a5 100644 --- a/src/lua/lua_util.c +++ b/src/lua/lua_util.c @@ -161,17 +161,14 @@ lua_util_load_rspamd_config (lua_State *L) cfg_name = luaL_checkstring (L, 1); if (cfg_name) { - cfg = g_malloc0 (sizeof (struct rspamd_config)); - rspamd_init_cfg (cfg, FALSE); - cfg->cache = rspamd_symbols_cache_new (cfg); + cfg = rspamd_config_defaults (); if (rspamd_config_read (cfg, cfg_name, NULL, NULL, NULL, NULL)) { msg_err_config ("cannot load config from %s", cfg_name); lua_pushnil (L); } else { - rspamd_config_post_load (cfg); - rspamd_symbols_cache_init (cfg->cache); + rspamd_config_post_load (cfg, FALSE); pcfg = lua_newuserdata (L, sizeof (struct rspamd_config *)); rspamd_lua_setclass (L, "rspamd{config}", -1); *pcfg = cfg; @@ -193,8 +190,8 @@ lua_util_config_from_ucl (lua_State *L) if (obj) { cfg = g_malloc0 (sizeof (struct rspamd_config)); - rspamd_init_cfg (cfg, FALSE); - cfg->lua_state = L; + cfg = rspamd_config_defaults (); + cfg->rcl_obj = obj; cfg->cache = rspamd_symbols_cache_new (cfg); top = rspamd_rcl_config_init (); @@ -205,8 +202,7 @@ lua_util_config_from_ucl (lua_State *L) lua_pushnil (L); } else { - rspamd_config_post_load (cfg); - rspamd_symbols_cache_init (cfg->cache); + rspamd_config_post_load (cfg, FALSE); pcfg = lua_newuserdata (L, sizeof (struct rspamd_config *)); rspamd_lua_setclass (L, "rspamd{config}", -1); *pcfg = cfg; |