void free_list(element *head) { element *nxt; while(nxt=head->next) { free(head); head=nxt; } free(head); }