void f() { Cell *theTop; Cell *thePtr; Cell *theNext; ... thePtr = theTop; while(NULL != thePtr){ theNext = thePtr->next; free(thePtr->name); free(thePtr); thePtr = theNext; } }