aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamadm/configtest.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-27 12:46:37 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-27 12:46:37 +0100
commit68cf5243462e0e9b743e420ab57a0be11055fc78 (patch)
tree0f33aa1b198f14788b2257839c182140a0e164ef /src/rspamadm/configtest.c
parent2a8231db5d2bb2590f419df73c5a529d39ff1a22 (diff)
downloadrspamd-68cf5243462e0e9b743e420ab57a0be11055fc78.tar.gz
rspamd-68cf5243462e0e9b743e420ab57a0be11055fc78.zip
[Minor] Fix various static leaks
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);
}