new_user->sock_fd should be assigned with int fd
Usersockname *new_user = to_malloc(sizeof(Usersockname)); // to_malloc is from friends.c
    new_user->username = to_malloc(strlen(name) + 1); 
    new_user->sock_fd = to_malloc(sizeof(int));
    new_user->next = to_malloc(sizeof(Usersockname)); 
    
    // There was a previous check on length size, so no need to recheck it again
    strncpy(new_user->username, name, strlen(name) + 1); // name has max length MAX_NAME - 1
    new_user->username[strlen(name)] = '\0'; // Null terminate
    *(new_user->sock_fd) = fd; 