pblock_done(Slapi_PBlock *pb)
{
#ifdef PBLOCK_ANALYTICS
    pblock_analytics_report(pb);
    pblock_analytics_destroy(pb);
#endif
    if (pb->pb_op != NULL) {
        operation_free(&pb->pb_op, pb->pb_conn);
        pb->pb_op = NULL;
    }
    slapi_ch_free((void **)&(pb->pb_dse));
    slapi_ch_free((void **)&(pb->pb_task));
    slapi_ch_free((void **)&(pb->pb_mr));
    slapi_ch_free((void **)&(pb->pb_deprecated));
    slapi_ch_free((void **)&(pb->pb_misc));
    if (pb->pb_intop != NULL) {
        delete_passwdPolicy(&pb->pb_intop->pwdpolicy);
        slapi_ch_free((void **)&(pb->pb_intop->pb_result_text));
    }
    slapi_ch_free((void **)&(pb->pb_intop));
    if (pb->pb_intplugin != NULL) {
        slapi_ch_free((void **)&(pb->pb_intplugin->pb_vattr_context));
    }
    slapi_ch_free((void **)&(pb->pb_intplugin));
}
pblock_done(Slapi_PBlock *pb)
{
#ifdef PBLOCK_ANALYTICS
    pblock_analytics_report(pb);
    pblock_analytics_destroy(pb);
#endif
    if (pb->pb_op != NULL) {
        operation_free(&pb->pb_op, pb->pb_conn);
        pb->pb_op = NULL;
    }
    slapi_ch_free((void **)&(pb->pb_dse));
    slapi_ch_free((void **)&(pb->pb_task));
    slapi_ch_free((void **)&(pb->pb_mr));
    slapi_ch_free((void **)&(pb->pb_deprecated));
    slapi_ch_free((void **)&(pb->pb_misc));
    if (pb->pb_intop != NULL) {
        delete_passwdPolicy(&pb->pb_intop->pwdpolicy);
        slapi_ch_free((void **)&(pb->pb_intop->pb_result_text));
    }
    slapi_ch_free((void **)&(pb->pb_intop));
    if (pb->pb_intplugin != NULL) {
        slapi_ch_free((void **)&(pb->pb_intplugin->pb_vattr_context));
    }
    slapi_ch_free((void **)&(pb->pb_intplugin));
}