summaryrefslogtreecommitdiffhomepage
path: root/src/main.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/main.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/main.c')
-rw-r--r--src/main.c3
1 files changed, 3 insertions, 0 deletions
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;