summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conf.c4
-rw-r--r--src/conf.h1
-rw-r--r--src/main.c3
3 files changed, 5 insertions, 3 deletions
diff --git a/src/conf.c b/src/conf.c
index b7c8da4..f0db500 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -286,7 +286,7 @@ free_added_headers (vector_t add_headers)
vector_delete (add_headers);
}
-static void free_config (struct config_s *conf)
+void free_config (struct config_s *conf)
{
safefree (conf->logf_name);
safefree (conf->stathost);
@@ -467,8 +467,6 @@ int reload_config_file (const char *config_fname, struct config_s *conf)
log_message (LOG_NOTICE, "Reloading config file");
- free_config (conf);
-
initialize_config_defaults (conf);
ret = load_config_file (config_fname, conf);
diff --git a/src/conf.h b/src/conf.h
index e89806a..8433381 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -116,5 +116,6 @@ struct config_s {
extern int reload_config_file (const char *config_fname, struct config_s *conf);
int config_compile_regex (void);
+void free_config (struct config_s *conf);
#endif
diff --git a/src/main.c b/src/main.c
index 2d695ed..42e8048 100644
--- a/src/main.c
+++ b/src/main.c
@@ -264,6 +264,7 @@ int reload_config (int reload_logging)
goto done;
}
+ if(config) free_config (config);
config = c_next;
if (reload_logging) ret = setup_logging ();
@@ -415,6 +416,8 @@ main (int argc, char **argv)
filter_destroy ();
#endif /* FILTER_ENABLE */
+ free_config (config);
+
shutdown_logging ();
return EXIT_SUCCESS;