struct node{ int position; char name[30]; struct node * next; }; void free_list(node * list){ node* next_node; printf("\n\n Freeing List: \n"); while(list != NULL) { next_node = list->next; printf("clear mem for: %s",list->name); free(list); list = next_node; printf("->"); } }