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/start-stop-daemon.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/start-stop-daemon.c')
-rw-r--r-- | src/rc/start-stop-daemon.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index e3673454..463983e4 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -116,13 +116,14 @@ static void free_schedulelist(void) TAILQ_INIT(&schedule); } +#ifdef DEBUG_MEMORY static void cleanup(void) { free(changeuser); free(nav); - free_schedulelist(); } +#endif static int parse_signal(const char *sig) { @@ -609,7 +610,9 @@ int start_stop_daemon(int argc, char **argv) unsigned int start_wait = 0; TAILQ_INIT(&schedule); +#ifdef DEBUG_MEMORY atexit(cleanup); +#endif signal_setup(SIGINT, handle_signal); signal_setup(SIGQUIT, handle_signal); |