From 1295f2228397f8d7566007d7e62f37e6169384d7 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Sun, 30 Nov 2008 16:49:54 +0100 Subject: Introduce config_stop() function This patch adds the config_stop function which is in charge of releasing ressources allocated for configuration file parsing. --- include/ulogd/conffile.h | 3 +++ src/conffile.c | 4 ++++ src/ulogd.c | 2 ++ 3 files changed, 9 insertions(+) diff --git a/include/ulogd/conffile.h b/include/ulogd/conffile.h index 826d9d5..7431243 100644 --- a/include/ulogd/conffile.h +++ b/include/ulogd/conffile.h @@ -67,4 +67,7 @@ int config_register_file(const char *file); /* parse the config file */ int config_parse_file(const char *section, struct config_keyset *kset); +/* release ressource allocated by config file handling */ +void config_stop(); + #endif /* ifndef _CONFFILE_H */ diff --git a/src/conffile.c b/src/conffile.c index 0c1a2a4..b27187e 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -222,3 +222,7 @@ cpf_error: return err; } +void config_stop() +{ + free(fname); +} diff --git a/src/ulogd.c b/src/ulogd.c index ae57a38..b079fd2 100644 --- a/src/ulogd.c +++ b/src/ulogd.c @@ -1013,6 +1013,8 @@ static void sigterm_handler(int signal) if (ulogd_logfile) free(ulogd_logfile); + config_stop(); + exit(0); } -- cgit v1.2.3