diff options
author | Roy Marples <roy@marples.name> | 2008-10-06 15:02:32 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-10-06 15:02:32 +0000 |
commit | cb44b0a46c9b1c72a84cf65e6b4d6ae735c0e413 (patch) | |
tree | c203264849ad86d67ddfb86242ef2aa0680a9b8b /src/rc/rc-misc.c | |
parent | 4e4c4a5bf4d5c463b79b5648e614b3b780efdbec (diff) |
#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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c index d4b3ca08..27846382 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)) { |