From f29447d9de03edd65d7f0c43b4c0df3270f3ca8f Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 6 Dec 2005 22:55:30 +0000 Subject: [PATCH] use helper to destroy modrdn modifications... --- servers/slapd/back-bdb/modrdn.c | 15 +++------------ servers/slapd/back-ldbm/modrdn.c | 13 +------------ 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 422420dcaf..6a25d2882d 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -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 */ diff --git a/servers/slapd/back-ldbm/modrdn.c b/servers/slapd/back-ldbm/modrdn.c index a88da9c518..5a58bd78a0 100644 --- a/servers/slapd/back-ldbm/modrdn.c +++ b/servers/slapd/back-ldbm/modrdn.c @@ -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 */