Fix a memory leak with dependency tracking.