what do i need to change to ensure the memory of the posts are being freed
int delete_user(const char *name, User **user_ptr_del) {
    // Delete user from list

    // Create a variable to traverse the list
    User *curr = *user_ptr_del;
    // Create a variable to hold the deleted user
    User *temp = *user_ptr_del;

    // Check for empty users list
    if (*user_ptr_del == NULL) {
        return 1;
    }

    remove_friends(name, user_ptr_del);

    // If there is 1 element in the list
    if (curr->next == NULL) {
        if (strcmp(curr->name, name) == 0) {
            *user_ptr_del = NULL;
            free(temp);
            return 0;
        } else {
            return 1;
        }
    }

    // If 1st element is to be removed
    if (strcmp(curr->name, name) == 0) {
        *user_ptr_del = curr->next;
        remove_friends(name, user_ptr_del);
        free(temp);
        return 0;
    }

    // Iterate through the users until the end of the list is reached,
    // or until the name of curr matches the name of the deleted user
    while (strcmp(curr->next->name, name) != 0 && curr->next != NULL) {
        curr = curr->next;
    }

    // If name does not exist
    if (curr->next == NULL) {
        return 1;
    }

    // If user to be removed is the last one
    if (curr->next->next == NULL) {
        temp = curr->next;
        curr->next = NULL;
    } else {
        // If user to be removed is in the middle of the list
        temp = curr->next;
        curr->next = curr->next->next;
    }


    Post *curr_post = temp->first_post;
    while (curr_post != NULL) {
        free(curr_post->date);
        free(curr_post);
        curr_post = curr_post->next;
    }

    // Free the memory in temp
    if (temp != NULL) {
        free(temp);
        temp = NULL;
    }
    return 0;
}
