I was wondering why you need to take a copy of the head in an iterating function ? All examples i have seen do this.
Won't head be local to this function and the head that was passed will still point to the correct place once it terminates?
e.g.
main
--------
ret = length(head);
--------------
int length(struct tag *head){
struct tag* current = head;
...