From: Pierangelo Masarati Date: Tue, 6 Dec 2005 22:54:51 +0000 (+0000) Subject: helper to destroy modrdn modifications... X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~639 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=662cb94e06ab708f8588eda44b4cec7e4dfe05f0;p=openldap helper to destroy modrdn modifications... --- diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index e455d71a8a..97f4997826 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -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 ); +} + diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index e18d9bcca3..0b0fd90cf0 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -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