Basically I have 2 linked list here: list and distinct. There are a few set of words which have been saved earlier into the \'list\' struct. Was gonna write a program that i
These three lines is one likely culprit:
if(ori == NULL && copy == NULL) { //first time. ori = ori->next; copy = copy->next;
Here you check if ori and copy are NULL, then you immediately dereference those NULL pointers!
ori
copy
NULL