int delete_user(const char *name, User **user_ptr_del) {
    User *curr = *user_ptr_del;
    User *prev = curr;
    int found = 0;
    char *friend_names[MAX_FRIENDS];

    // Traverse list of users
    while (curr != NULL) {
        // Check if current user has given name
        if (strcmp(curr->name, name) == 0) {
            found = 1;
            User *curr_friend;

            // Iterate over friend list
            for (int i = 0; i < MAX_FRIENDS; i++) {
                curr_friend = (curr->friends)[i];

                // Check if current user is empty
                if (curr_friend->name == NULL) {
                    break;
                } else {
                    // If not, append name to list of friend names
                    friend_names[i] = curr_friend->name;
                }
            }

            // Remove user from user list
            if (strcmp(prev->name, curr->name) == 0) {
                // If current user is only user
                *user_ptr_del = NULL;
            } else {
                prev->next = curr->next;
            }

            break;
        }
        prev = curr;
        curr = curr->next;
    }

    // Check if user was not found
    if (!(found)) {
        return 1;
    }

    // Remove user from all friends' lists
    char *curr_friend;
    for (int i = 0; i < MAX_FRIENDS; i++) {
        curr_friend = friend_names[i];

        printf("%s\n", curr_friend);
        // Check if current user is empty
        if (curr_friend == NULL) {
            break;
        }

        // Remove user from this friend's list
        delete_friend(name, curr_friend, user_ptr_del);
    }

    // Free space allocated for user
    free(curr);

    return 0;
}
The friend_names array should contain the names of friends contained in curr. However, the array also contains garbage values, making it impossible to check for NULL strings.