summaryrefslogtreecommitdiff
path: root/src/rc/rc-misc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-10-06 15:02:32 +0000
committerRoy Marples <roy@marples.name>2008-10-06 15:02:32 +0000
commitcb44b0a46c9b1c72a84cf65e6b4d6ae735c0e413 (patch)
treec203264849ad86d67ddfb86242ef2aa0680a9b8b /src/rc/rc-misc.c
parent4e4c4a5bf4d5c463b79b5648e614b3b780efdbec (diff)
downloadopenrc-cb44b0a46c9b1c72a84cf65e6b4d6ae735c0e413.tar.gz
openrc-cb44b0a46c9b1c72a84cf65e6b4d6ae735c0e413.tar.bz2
openrc-cb44b0a46c9b1c72a84cf65e6b4d6ae735c0e413.tar.xz
#ifdef atexit cleanups calling free as the OS should do this for us, but valgrind debuggers need it.
Diffstat (limited to 'src/rc/rc-misc.c')
-rw-r--r--src/rc/rc-misc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c
index d4b3ca0..2784638 100644
--- a/src/rc/rc-misc.c
+++ b/src/rc/rc-misc.c
@@ -61,10 +61,12 @@ static RC_STRINGLIST *rc_conf = NULL;
extern char** environ;
+#ifdef DEBUG_MEMORY
static void _free_rc_conf(void)
{
rc_stringlist_free(rc_conf);
}
+#endif
char *rc_conf_value(const char *setting)
{
@@ -74,7 +76,9 @@ char *rc_conf_value(const char *setting)
if (! rc_conf) {
rc_conf = rc_config_load(RC_CONF);
+#ifdef DEBUG_MEMORY
atexit(_free_rc_conf);
+#endif
/* Support old configs */
if (exists(RC_CONF_OLD)) {