MY code is giving segmentation fault and not giving correct output

linked list functions

the fault comes when i call mergesort


here is my submitted solution on leetcode for merge sort

i knew the correct code i asked for my mistake

i have written same code as prateek bhaiya