summaryrefslogtreecommitdiffhomepage
path: root/src/conf.c
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-09-15 23:01:44 +0100
committerrofl0r <rofl0r@users.noreply.github.com>2020-09-15 23:11:59 +0100
commit9d5ee85c3ecc01d679ff23f25fa0efbf6743e7a2 (patch)
tree6156853eb22943f584a366fcb1d24bc15fbd47e2 /src/conf.c
parent372d7ff8241888bc3895182b39497fa23381b7e7 (diff)
fix free()ing of config items
- we need to free the config after it has been succesfully loaded, not unconditionally before reloading. - we also need to free them before exiting from the main program to have clean valgrind output.
Diffstat (limited to 'src/conf.c')
-rw-r--r--src/conf.c4
1 files changed, 1 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);