diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 30af7693dd..392a6c68e2 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -395,12 +395,15 @@ slap_mods2entry( const char **text, char *textbuf, size_t textlen ) { - Attribute **tail = &(*e)->e_attrs; + Attribute **tail; if ( initial ) { - assert( *tail == NULL ); + assert( (*e)->e_attrs == NULL ); } + for ( tail = &(*e)->e_attrs; *tail != NULL; tail = &(*tail)->a_next ) + ; + *text = textbuf; for( ; mods != NULL; mods = mods->sml_next ) {