Why am I getting a segmentation fault?
int make_friends(const char *name1, const char *name2, User *head) {
    // points the user objects with the provided usernames if they exist, NULL otherwise
    User *first_user = find_user(name1, head);
    User *second_user = find_user(name2, head);

    if ((first_user == NULL) || (second_user == NULL)) {
        return 4; // if either user was not found through our search, return 4
    }

    if (strcmp(name1, name2) == 0) {
        return 3; // return 3 if the usernames are the same (same user was provided twice)
    }

    // the location of a free space in either user's friends list, set to -1 if no free spaces are available
    int first_user_empty_index = first_empty_friends_index(first_user);
    int second_user_empty_index = first_empty_friends_index(second_user);

    if (first_user_empty_index == -1 || second_user_empty_index == -1) {
        return 2; // if either index is -1, there are no empty places in one of their friends lists so return 2
    }

    if (check_friends_helper(first_user, second_user) == 0) {
        return 1; // return 1 if the users are already friends
    }

    // setting the values at the friends list indexes to the other user in each user object
    (first_user->friends)[first_user_empty_index] = first_user;
    (second_user->friends)[second_user_empty_index] = second_user;

    return 0;
}