]> git.sur5r.net Git - openldap/commitdiff
use helper to destroy modrdn modifications...
authorPierangelo Masarati <ando@openldap.org>
Tue, 6 Dec 2005 22:55:30 +0000 (22:55 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 6 Dec 2005 22:55:30 +0000 (22:55 +0000)
servers/slapd/back-bdb/modrdn.c
servers/slapd/back-ldbm/modrdn.c

index 422420dcafc84e0c2d582fe274b073b1fff3bf9b..6a25d2882d0d49ac1844bc5c8b812039fde36463 100644 (file)
@@ -796,22 +796,13 @@ done:
        if ( new_rdn != NULL ) {
                ldap_rdnfree_x( new_rdn, op->o_tmpmemctx );
        }
+
        if ( old_rdn != NULL ) {
                ldap_rdnfree_x( old_rdn, op->o_tmpmemctx );
        }
+
        if( mod != NULL ) {
-               Modifications *tmp;
-               for (; mod; mod=tmp ) {
-                       tmp = mod->sml_next;
-                       /* slap_modrdn2mods does things one way,
-                        * slap_mods_opattrs does it differently
-                        */
-                       if ( mod->sml_op != SLAP_MOD_SOFTADD &&
-                               mod->sml_op != LDAP_MOD_DELETE ) break;
-                       if ( mod->sml_nvalues ) free( mod->sml_nvalues[0].bv_val );
-                       free( mod );
-               }
-               slap_mods_free( mod, 1 );
+               slap_modrdn2mods_free( mod );
        }
 
        /* LDAP v3 Support */
index a88da9c5185f9a7443b106ef3244589ebeb83e2e..5a58bd78a0cefcb8d4b9e1b4fc8fe06adbe03ae6 100644 (file)
@@ -472,18 +472,7 @@ return_results:
                ldap_rdnfree( old_rdn );
        }
        if ( mod != NULL ) {
-               Modifications *tmp;
-               for (; mod; mod = tmp ) {
-                       /* slap_modrdn2mods does things one way,
-                        * slap_mods_opattrs does it differently
-                        */
-                       if ( mod->sml_op != SLAP_MOD_SOFTADD &&
-                               mod->sml_op != LDAP_MOD_DELETE ) break;
-                       if ( mod->sml_nvalues ) free( mod->sml_nvalues[0].bv_val );
-                       tmp = mod->sml_next;
-                       free( mod );
-               }
-               slap_mods_free( mod, 1 );
+               slap_modrdn2mods_free( mod );
        }
 
        /* LDAP v3 Support */