- if ( !BER_BVISNULL( &ros->ro_dn ) ) {
- op->o_req_dn = ros->ro_dn;
- }
- if ( !BER_BVISNULL( &ros->ro_ndn ) ) {
- op->o_req_ndn = ros->ro_ndn;
- }
+ /* in case of successful extended operation cleanup
+ * gets called *after* (ITS#6632); this hack counts
+ * on others to cleanup our o_req_dn/o_req_ndn,
+ * while we cleanup theirs. */
+ if ( ros->r_tag == LDAP_REQ_EXTENDED && rs->sr_err == LDAP_SUCCESS ) {
+ if ( !BER_BVISNULL( &ros->rx_dn ) ) {
+ ch_free( ros->rx_dn.bv_val );
+ }
+ if ( !BER_BVISNULL( &ros->rx_ndn ) ) {
+ ch_free( ros->rx_ndn.bv_val );
+ }