#ifdef atexit cleanups calling free as the OS should do this for us, but valgrind debuggers need it.

This commit is contained in:
Roy Marples
2008-10-06 15:02:32 +00:00
parent 4e4c4a5bf4
commit cb44b0a46c
6 changed files with 30 additions and 17 deletions

View File

@@ -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)) {