load_config: fix free before use