]> git.sur5r.net Git - openldap/commitdiff
back out prev commit
authorJong Hyuk Choi <jongchoi@openldap.org>
Fri, 24 Sep 2004 07:26:44 +0000 (07:26 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Fri, 24 Sep 2004 07:26:44 +0000 (07:26 +0000)
servers/slapd/add.c

index 17505c90a18d6d65d24d64ad26109780910cb49e..d4f6b6b914eb0457ab28027e8b5cf419af281110 100644 (file)
@@ -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;
                        }