]> git.sur5r.net Git - openldap/commitdiff
helper to destroy modrdn modifications...
authorPierangelo Masarati <ando@openldap.org>
Tue, 6 Dec 2005 22:54:51 +0000 (22:54 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 6 Dec 2005 22:54:51 +0000 (22:54 +0000)
servers/slapd/modrdn.c
servers/slapd/proto-slap.h

index e455d71a8a11f11b826d76f327379d1e4d393de8..97f499782660db6ac4706cf01e23a46badb21571 100644 (file)
@@ -519,3 +519,30 @@ done:
 
        return rs->sr_err;
 }
+
+void
+slap_modrdn2mods_free( Modifications *mod )
+{
+       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 );
+}
+
index e18d9bcca3315c6f8cc0c2ea49e73309ebf5ad7a..0b0fd90cf0083a9f6b722cec7e3e0beae65feda4 100644 (file)
@@ -1016,13 +1016,15 @@ LDAP_SLAPD_F (int) filter_matched_values(
 /*
  * modrdn.c
  */
-LDAP_SLAPD_F (int) slap_modrdn2mods(
+LDAP_SLAPD_F (int) slap_modrdn2mods LDAP_P((
        Operation       *op,
        SlapReply       *rs,
        Entry           *e,
        LDAPRDN         oldrdn,
        LDAPRDN         newrdn,
-       Modifications   **pmod );
+       Modifications   **pmod ));
+
+LDAP_SLAPD_F (void) slap_modrdn2mods_free LDAP_P(( Modifications *mod ));
 
 /*
  * modify.c