int delete_user(const char *name, User **user_ptr_del) {
    User *leaver = find_user(name, *user_ptr_del); //The user we want to delete  
    User *curr = *user_ptr_del; //for traversal   
    if(leaver == NULL || curr == NULL){ //check if leaver exists and if the userlist has anything in it  
        return 1;  
    }  
    if(curr == leaver){ //checks head case if leaver is there  
        *user_ptr_del = curr->next;  
    }  
    while(curr->next != NULL){
        if(curr->next == leaver){
            curr->next = curr->next->next;
        }
        curr = curr->next;
    }  
    for(int i = 0; i< 10; i++){
        if(leaver->friends[i] == NULL){
            continue;
        }
        int k = 0;
        for(int j = 0; j<10; j++){
            if(leaver->friends[i]->friends[j] != leaver){
                leaver->friends[i]->friends[k] = leaver->friends[i]->friends[j];
                k++;
            }
        }
        while(k<9){
            leaver->friends[i]->friends[k+1] = NULL;
            k+=1;
        }
    }
    // free(leaver->name);
    for(int i = 0; i<10; i++){
        leaver->friends[i] = NULL;
    }
    while(leaver->first_post != NULL){  
        Post *temp = leaver->first_post->next;  //temp post
        free(leaver->first_post->contents);  
        free(leaver->first_post->date);  
        free(leaver->first_post);  
        leaver->first_post = temp;  
    }  
    free(leaver);  
      
    return 0;
}
fix memory leak