config_file: Guard against calloc/malloc/realloc failure cases