config_file: Guard against possible malloc/realloc failures.