summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Leblond <eric@inl.fr>2008-11-30 16:49:54 +0100
committerEric Leblond <eric@inl.fr>2008-12-09 01:19:25 +0100
commit1295f2228397f8d7566007d7e62f37e6169384d7 (patch)
treeaaa86084d6148a3006ecaccb29ba08398ecc538a
parent7e02ae896e3b4f3109ea26069884695799793370 (diff)
Introduce config_stop() function
This patch adds the config_stop function which is in charge of releasing ressources allocated for configuration file parsing.
-rw-r--r--include/ulogd/conffile.h3
-rw-r--r--src/conffile.c4
-rw-r--r--src/ulogd.c2
3 files changed, 9 insertions, 0 deletions
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);
}