rc = (*callback)( pb );
if ( rc == SLAPI_PLUGIN_EXTENDED_SENT_RESULT ) {
- slapi_pblock_destroy( pb );
- return rc;
+ goto cleanup;
} else if ( rc == SLAPI_PLUGIN_EXTENDED_NOT_HANDLED ) {
- slapi_pblock_destroy( pb );
- return SLAP_CB_CONTINUE;
+ rc = SLAP_CB_CONTINUE;
+ goto cleanup;
}
assert( rs->sr_rspoid != NULL );
if ( rs->sr_rspdata != NULL )
ber_bvfree( rs->sr_rspdata );
+ rc = rs->sr_err;
+
+cleanup:
slapi_pblock_destroy( pb );
+ op->o_callback = cb.sc_next;
- return rs->sr_err;
+ return rc;
}
static int
rc = SLAP_CB_CONTINUE;
}
- op->o_callback = cb.sc_next;
-
- if ( !internal_op )
+ if ( !internal_op ) {
slapi_pblock_destroy( pb );
+ }
+
+ op->o_callback = cb.sc_next;
return rc;
}
if ( e != target ) {
be_entry_release_r( op, e );
}
+
+ op->o_callback = cb.sc_next;
} else {
rc = LDAP_NO_SUCH_OBJECT; /* return SLAP_CB_CONTINUE for correctness? */
}