Why is the value of user not being stored in user_ptr_add properly
int create_user(const char *name, User **user_ptr_add) {
    
    User user;
  
    if(strlen(name) > sizeof(user.name) - 1){
        return 2;
    }
    strcpy(user.name, name);

    *user_ptr_add = malloc(sizeof(User));
    User *temp = *user_ptr_add;

    if (temp == NULL){
        temp[0] = user;
        return 0;
    }

    while (temp->next != NULL){

        if(strcmp(temp->name, name) == 0){
            return 1;    
        }

        temp = temp->next;
    }

    temp->next = &user;
    return 0;
}