int delete_user(const char *name, User **user_ptr_del) {
    User *leaver = find_user(name, *user_ptr_del);
    User *curr = *user_ptr_del;
    if(leaver == NULL || curr == NULL){
        return 1;
    }
    if(curr == leaver){
        *user_ptr_del = curr->next;
    }
    for(int i = 0; i < 10; i++){
        if(curr->next->friends[i]==leaver){
        curr->next->friends[i] = NULL;
        }
    }
    while(curr->next != NULL){
        if(curr->next == leaver){
            User *a = curr->next;
            free(a);
            curr->next = curr->next->next;
        }
        else{
            for(int i = 0; i < 10; i++){
                if(curr->next->friends[i]==leaver){
                    curr->next->friends[i] = NULL;
                }
            }
        }
        curr = curr->next;
    }
    return 1;   
}
fix segmentation fault