int create_user(const char *name, User **user_ptr_add) {  
    User *curr = *user_ptr_add;  
    int res = 0;  
/*Check whether the user name already exists in the list  
 */  
    while (curr->next){  
        if (curr->name == name){  
            res = 1;  
        }  
        curr = curr->next;  
    }  
    if (res == 1){  
        return res;  
    }  
  
/*Check whether the given name cannot fit in the 'name' array 
 */  
    if (strlen(name) > MAX_NAME - 1){  
        return 2;  
    }  
  
/*Create the user with name 
 */  
    User u1;  
    strcpy(u1.name,name);  
    curr->next = &u1;  
    return 0;  
}  
how to solve the segmentation fault.