/* Set up conditional logging */
if (cfg->debug_ip_map != NULL) {
/* Try to add it as map first of all */
+ if (rspamd_log->debug_ip) {
+ radix_tree_free (rspamd_log->debug_ip);
+ }
rspamd_log->debug_ip = radix_tree_create ();
if (!add_map (cfg->debug_ip_map, read_radix_list, fin_radix_list, (void **)&rspamd_log->debug_ip)) {
/* Try to parse it as list */
g_strfreev (strvec);
}
}
+ else if (rspamd_log->debug_ip) {
+ radix_tree_free (rspamd_log->debug_ip);
+ rspamd_log->debug_ip = NULL;
+ }
}
int
init_lua_filters (struct config_file *cfg)
{
struct config_file **pcfg;
- gpointer *plogger;
GList *cur, *tmp;
struct script_module *module;
struct statfile *st;
lua_setclass (L, "rspamd{config}", -1);
*pcfg = cfg;
lua_setglobal (L, "rspamd_config");
- /* Initialize logger */
- plogger = lua_newuserdata (L, sizeof (gpointer));
- lua_setclass (L, "rspamd{logger}", -1);
- *plogger = NULL;
- lua_setglobal (L, "rspamd_log");
/* do the call (1 arguments, 1 result) */
if (lua_pcall (L, 0, LUA_MULTRET, 0) != 0) {