Fix memory leak caused by crashing daemons.