why do I get a segmentation fault in this program
int create_user(const char *name, User **user_ptr_add) {
    if (strlen(name) >= 32){
        return 2;
    }

    User *curr = *user_ptr_add;
    while(curr->next != NULL){
        if (strcmp(name, curr->name) == 0){
            return 1;
        }
        curr = curr->next;
    }

    User new_person;
    strcpy(new_person.name, name);
    curr->next = &new_person;
    return 0;

}