Fix possible memory leak when encountering an invalid option in the config file