From 3f6daa468089b01284d5af8f1e1c01e3a66a8990 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Sun, 1 Jan 2006 14:25:09 +0000 Subject: [PATCH] Initialize sml_type Don't clobber sml_type when converting SLAPI mods --- servers/slapd/modrdn.c | 2 ++ servers/slapd/slapi/slapi_utils.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index 98902ae156..e2eb60aed6 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -436,6 +436,7 @@ slap_modrdn2mods( /* Apply modification */ mod_tmp = ( Modifications * )ch_malloc( sizeof( Modifications ) ); mod_tmp->sml_desc = desc; + BER_BVZERO( &mod_tmp->sml_type ); mod_tmp->sml_values = ( BerVarray )ch_malloc( 2 * sizeof( struct berval ) ); ber_dupbv( &mod_tmp->sml_values[0], &new_rdn[a_cnt]->la_value ); mod_tmp->sml_values[1].bv_val = NULL; @@ -476,6 +477,7 @@ slap_modrdn2mods( /* Apply modification */ mod_tmp = ( Modifications * )ch_malloc( sizeof( Modifications ) ); mod_tmp->sml_desc = desc; + BER_BVZERO( &mod_tmp->sml_type ); mod_tmp->sml_values = ( BerVarray )ch_malloc( 2 * sizeof( struct berval ) ); ber_dupbv( &mod_tmp->sml_values[0], &old_rdn[d_cnt]->la_value ); mod_tmp->sml_values[1].bv_val = NULL; diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index 74a2bdee43..58c8694036 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -2717,7 +2717,6 @@ LDAPMod **slapi_int_modifications2ldapmods( Modifications *modlist ) modp->mod_type = slapi_ch_strdup( ml->sml_desc->ad_cname.bv_val ); } else { modp->mod_type = slapi_ch_strdup( ml->sml_type.bv_val ); - BER_BVZERO( &ml->sml_type ); } if ( ml->sml_values != NULL ) { -- 2.39.5