free allocated memory from `name_list`