Fixed resource leak in config.