Fix a memory leak that can happen with invalid configuration files.