will this correctly remove the data in post? should i set it to null as well?
void free_posts(Post *post_ptr) {
    Post *curr = post_ptr;  // Create a variable to traverse the linked list
    while (curr != NULL) {
        Post *temp_post = curr;  // Create a temporary variable to hold a post
        curr = curr->next;
        if (temp_post != NULL) {   // If the post is not null, free the post and its contents
            free(temp_post->date);
            free(temp_post->contents);
            free(temp_post);
        }
    }
}