getting segmentation fault, how to fix it?
int make_friends(const char *name1, const char *name2, User *head) {
    User *user1 = find_user(name1, head);
    User *user2 = find_user(name2, head);

    if (user1 == NULL || user2 == NULL) {
        printf("One or both users are NULL");
        return 4;
    }
    
    printf("The first user is %s", user1->name);
    printf("The second user is %s", user2->name);

    if (strcmp(name1, name2) == 0) {
        return 3;
    }

    int user_one_friends = 0;
    int user_two_friends = 0;
    int already_friends = 0;

    for (int i = 0; i < MAX_FRIENDS - 1; i++){
        if ((user1->friends[i])->name != NULL) {
            if (strcmp((user1->friends[i])->name, user2->name) == 0) {
            already_friends += 1;
            user_one_friends++;
        }
        }
        if ((user2->friends[i])->name != NULL) {
            if (strcmp((user1->friends[i])->name, user2->name) == 0) {
            already_friends += 1;
            user_two_friends++;
        }
    }
    }

    if (already_friends == 2) {
        return 1;
    }

    if (user_one_friends == MAX_FRIENDS || user_two_friends == MAX_FRIENDS) {
        return 2;
    }

    for (int i = 0; i < MAX_FRIENDS - 1; i++){
        if ((user1->friends[i])->name == NULL) {
            user1->friends[i] = user2;
            break;
    }
    }
    for (int i = 0; i < MAX_FRIENDS - 1; i++){
        if ((user2->friends[i])->name == NULL) {
            user2->friends[i] = user1;
            break;
    }
    }
    
    return 0;
}