aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamadm/configtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rspamadm/configtest.c')
-rw-r--r--src/rspamadm/configtest.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rspamadm/configtest.c b/src/rspamadm/configtest.c
index 3b7a6b5b0..6c07959db 100644
--- a/src/rspamadm/configtest.c
+++ b/src/rspamadm/configtest.c
@@ -121,9 +121,12 @@ rspamadm_configtest (gint argc, gchar **argv, const struct rspamadm_command *cmd
if (!g_option_context_parse (context, &argc, &argv, &error)) {
fprintf (stderr, "option parsing failed: %s\n", error->message);
g_error_free (error);
+ g_option_context_free (context);
exit (1);
}
+ g_option_context_free (context);
+
if (config == NULL) {
if ((confdir = g_hash_table_lookup (ucl_vars, "CONFDIR")) == NULL) {
confdir = RSPAMD_CONFDIR;
@@ -139,7 +142,7 @@ rspamadm_configtest (gint argc, gchar **argv, const struct rspamadm_command *cmd
(void) g_quark_from_static_string ((*pworker)->name);
pworker++;
}
- cfg->cache = rspamd_symcache_new (cfg);
+
cfg->compiled_modules = modules;
cfg->compiled_workers = workers;
cfg->cfg_name = config;
@@ -160,8 +163,8 @@ rspamadm_configtest (gint argc, gchar **argv, const struct rspamadm_command *cmd
ret = rspamd_config_post_load (cfg, RSPAMD_CONFIG_INIT_SYMCACHE);
}
- if (ret && !rspamd_symcache_validate (rspamd_main->cfg->cache,
- rspamd_main->cfg,
+ if (ret && !rspamd_symcache_validate (cfg->cache,
+ cfg,
FALSE)) {
ret = FALSE;
}
@@ -185,6 +188,4 @@ rspamadm_configtest (gint argc, gchar **argv, const struct rspamadm_command *cmd
if (!ret) {
exit (EXIT_FAILURE);
}
-
- exit (EXIT_SUCCESS);
}