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 base case if leaver is there
        *user_ptr_del = curr->next;
    }
    else if(curr != leaver){ //checks friendlist of curr to remove leaver if leaver is not the first element in the linked list
        int j = 0;
        for(int i = 0; i<10; i++){
            if(curr->next->friends[i] != leaver){   
                curr->next->friends[j] = curr->next->friends[i];
                j++;               
            }
        }
        if(j == 8){
            curr->friends[9] = NULL;
        }
    }
    while(curr->next != NULL){ //how we traverse through the loop
        if(curr->next == leaver){ //action if a user is the leaver
            curr->next = curr->next->next;
        }
        else{ //checkes elements for leaver as a friend
            int j = 0;
            for(int i = 0; i < 10; i++){
                if(curr->next->friends[i] != leaver){   
                    curr->next->friends[j] = curr->next->friends[i];
                    j++;               
                }
                }
            if(j == 8){
                curr->next->friends[9] = NULL;
            }
        }
        curr = curr->next;
    }
    free(leaver->profile_pic);
    free(leaver->name);
    for(int i = 0; i<10; i++){
        leaver->friends[i] = NULL;
    }
    free(leaver->friends);
    while(leaver->first_post != NULL){
        Post *b = leaver->first_post->next;
        free(leaver->first_post->author);
        free(leaver->first_post->contents);
        free(leaver->first_post->date);
        free(leaver->first_post);
        leaver->first_post = b;
    }
    free(leaver);
    
    return 0;   
}
help with freeing memory stored in leaver