Is this a valid LinkedList destructor? I\'m still sort of confused by them.
I want to make sure I\'m understanding this correctly.
LinkedList::~Link
Your code might be correct, you should try running it with e.g. valgrind and see what it says. However, I would write it like this:
for (ListNode *current = head, *next; current; current = next) { next = current->next; free(current); }