Please check the code
there is a mistake in line no. 61, you are inserting both linked list in temp1. make it temp2. Also in line no 46, fast pointer can never be equals to slow pointer since they both are different linkedlists although their data can be equal. So change it to if(fast->data == slow->data)