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

Ensure that user_ptr_add is not mutated when the function returns