int create_user(const char *name, User **user_ptr_add) {
    if (strlen(name) > MAX_NAME - 1) {
        return 2;
    }
    User *new_user = malloc(sizeof(User));
    new_user->name = malloc(sizeof(char) * MAX_NAME);
    strcpy(new_user->name, name);
    new_user->next = NULL;
    User *curr = *user_ptr_add;
    while (*curr->next != NULL) {
        if *curr->name == name) {
            return 1;
        }
        *curr = curr->next;
    }
    *curr->next = new_user;
    return 0;
}

not get segmentation fault