There is certainly a problem with this code: the for loop you are executing is equivalent to
current = head;
while (current!=NULL) {
free(current);
current=current->next;
}
That is you are accessing current
after the free.
You should change this to
current = head;
while (current!=NULL) {
tmp = current;
current=current->next;
free(tmp);
}