why segmentation fault
int delete_user(const char *name, User **user_ptr_del) {
    User *user = find_user(name, *user_ptr_del);

    if (user == NULL) {
        return 1;
    }

    User *curr = *user_ptr_del; 

    while(strcmp(curr->next->name, name) == 0) {
        curr = curr->next;
    }

    curr->next = curr->next->next;

    for (int i = 0; i < MAX_FRIENDS; i++) {
        User *curr_friend = user->friends[i];

        int index = 0;
        for(int j = 0; j < MAX_FRIENDS; j++) {
            
            if (strcmp(curr_friend->friends[j]->name, name) == 0) {
                index = j;
            }
        }

        for (int k = index; k + 1 < MAX_FRIENDS; k++) {
            curr_friend->friends[k] = curr_friend->friends[k+1];
        }

        if (index == MAX_FRIENDS - 1) {
            curr_friend->friends[index] = NULL;
        }
    }

    Post *curr_post = user->first_post;

    while(curr_post != NULL) {
        Post *p = curr_post;

        curr_post = curr_post->next;

        free(p->date);
        free(p->contents);
        free(p);
    }

    free(user);

    return 0;
}