From c7d4f2841ef5089cfdd222fbd3ad90aa650073f5 Mon Sep 17 00:00:00 2001 From: Jong Hyuk Choi Date: Fri, 24 Sep 2004 07:26:44 +0000 Subject: [PATCH] back out prev commit --- servers/slapd/add.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.39.5