Hi.
I wrote two functions that deal with a linked list of structures. The first function is supposed to print all the students in the list and the second has to find a certain student in the list and return true if the student is in the list and false otherwise.

My printing function works (it outputs the names and GPAs of the students) but it crashes the program after execution. The isThere() function works perfectly if the string I am looking for is in the list, otherwise it also crashes my program.

My student structures are entered in the list using a "push" function and are deleted using a pop function. here are the functions I am using:

Code:
struct stu
{
	char* name;
	int GPA;
    struct stu* next;


};







void push(struct stu* *head,char* name ,int GPA)
{   
	
	struct stu* temp = (struct stu*) malloc(sizeof(struct stu));
	temp->name = name;
	temp->GPA = GPA;
	temp->next = *head;


	*head = temp;

}



struct stu pop (struct stu* head)
{
  
	return *head;

	head = head->next;

}


void print(struct stu* head)
{

    struct stu* temp;

	temp = head;

	while(temp != NULL)

	{

        printf("The Name of the Student is : %s \n The GPA of the student is : %d \n",
		   temp->name, temp->GPA);

		temp = temp->next;
	}

        
}


int isThere(struct stu* head, char* key) 
{
    int moreToSearch = 0;
	int flag = 0;
    struct stu* temp;
	temp = head;

	moreToSearch = (temp != NULL);



	while(moreToSearch && flag ==0)
	{
		if(strcmp(temp->name, key) ==0)
			flag =1;

		else
	 
		{ temp = temp->next;
          moreToSearch = (temp != NULL);

		}

	}

	
  return flag;


}
Anyhelp would be appreciated. Especially with the isThere and Print functions! Thanks!