I am building a program for my brother to edit a few things on his website that I do not want to be bothered with. The one I am working on now is the EVENTS page. What is going on is that I am reading a JavaScript file and as the lines are called the elements are broken down and stored into a linked list. Once the editing is done the file is cleared and rewritten. A default page is saved as a backup if any problems arise. The problem I am having has to be me being stupid. I am in a function making a new node for the linked list. I ask the user for all the inputs the try to assign the next and last attributes to the node. At that point the program crashes? I have no idea why.
Code:
void NewEvent(Event *list)
{
    Event *NewEvent = new Event;
    NewEvent = SetEvent();/// gets the user data for the event
    NewEvent->next = list;
    list->last = NewEvent; /// this is where the debugger catches a problem
    list = NewEvent;
    WriteEventFile(list);

}
I will post all the code if the problem is not an obvious one.