From 6461a5b7fd891b1cfc196bd0cfd1b1938b1f4559 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Tue, 9 Aug 2005 02:12:18 +0000 Subject: [PATCH] ITS#3924 --- servers/slapd/slapi/slapi_utils.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index 867cc56659..8e7b656468 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -2720,8 +2720,14 @@ LDAPMod **slapi_int_modifications2ldapmods( Modifications **pmodlist ) mods[i] = (LDAPMod *)slapi_ch_malloc( sizeof(LDAPMod) ); modp = mods[i]; modp->mod_op = ml->sml_op | LDAP_MOD_BVALUES; - modp->mod_type = slapi_ch_strdup( ml->sml_type.bv_val ); - ml->sml_type.bv_val = NULL; + if ( BER_BVISNULL( &ml->sml_type ) ) { + /* may happen for internally generated mods */ + assert( ml->sml_desc != NULL ); + 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 ) { for( j = 0; ml->sml_values[j].bv_val != NULL; j++ ) -- 2.39.5