Fix segfault from last memory-leak fixing patch.