]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/modrdn.c
ITS#4532 fix
[openldap] / servers / slapd / back-bdb / modrdn.c
index 4a7f6e862665fa2f028d9685bdca09f293f30b01..73a35df708ca475994466b632a13275c74982dcd 100644 (file)
@@ -787,6 +787,8 @@ return_results:
        }
 
 done:
+       slap_graduate_commit_csn( op );
+
        if( new_dn.bv_val != NULL ) free( new_dn.bv_val );
        if( new_ndn.bv_val != NULL ) free( new_ndn.bv_val );
 
@@ -824,11 +826,11 @@ done:
        }
        op->o_private = NULL;
 
-       if( preread_ctrl != NULL ) {
+       if( preread_ctrl != NULL && (*preread_ctrl) != NULL ) {
                slap_sl_free( (*preread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
                slap_sl_free( *preread_ctrl, op->o_tmpmemctx );
        }
-       if( postread_ctrl != NULL ) {
+       if( postread_ctrl != NULL && (*postread_ctrl) != NULL ) {
                slap_sl_free( (*postread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
                slap_sl_free( *postread_ctrl, op->o_tmpmemctx );
        }