why am i getting a segmentation fault
int create_user(const char *name, User **user_ptr_add) {
    if (strlen(name) > 31){
        return 2;
    }

    User *curr = *user_ptr_add;  
    // traversing through list
    while (curr->next != NULL && curr != NULL){
        // check if name exists
        if (curr->name == name){
            return 1;
        }
        curr = curr->next;
    }

    // creating a new user
    User *new_user = malloc(sizeof(User));
    strcpy(new_user->name, name);
    new_user->next = curr->next;

    // insert at end
    curr->next = new_user;

    return 0;
}