From: Jong Hyuk Choi Date: Fri, 24 Sep 2004 07:26:44 +0000 (+0000) Subject: back out prev commit X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~508 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c7d4f2841ef5089cfdd222fbd3ad90aa650073f5;p=openldap back out prev commit --- diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 17505c90a1..d4f6b6b914 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -425,6 +425,10 @@ slap_mods2entry( AC_MEMCPY( &attr->a_vals[i], mods->sml_values, sizeof( struct berval ) * j ); + /* trim the mods array */ + ch_free( mods->sml_values ); + mods->sml_values = NULL; + if( mods->sml_nvalues ) { attr->a_nvals = ch_realloc( attr->a_nvals, sizeof( struct berval ) * (i+j) ); @@ -432,6 +436,10 @@ slap_mods2entry( AC_MEMCPY( &attr->a_nvals[i], mods->sml_nvalues, sizeof( struct berval ) * j ); + /* trim the mods array */ + ch_free( mods->sml_nvalues ); + mods->sml_nvalues = NULL; + } else { attr->a_nvals = attr->a_vals; }