why is there segamentatuin fault
int create_user(const char *name, User **user_ptr_add) {
    if (strlen(name) >= MAX_NAME) {
        return 2;
    }
    User *curr = *user_ptr_add;
    User *new_user = malloc(sizeof(User));

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

    strcpy(new_user->name, name);
    new_user->next = NULL;
    if (user_ptr_add == NULL) {
        *user_ptr_add = new_user;
    } else {
        curr = *user_ptr_add;
        while (curr != NULL) {
            curr = curr->next;
        }
        curr->next = new_user;
    }
    return 0;
}