]> git.sur5r.net Git - openldap/commitdiff
a memory fix for slap_mods2entry(): don't trim mods array - trim it outside
authorJong Hyuk Choi <jongchoi@openldap.org>
Tue, 21 Sep 2004 03:08:07 +0000 (03:08 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Tue, 21 Sep 2004 03:08:07 +0000 (03:08 +0000)
servers/slapd/add.c

index d4f6b6b914eb0457ab28027e8b5cf419af281110..17505c90a18d6d65d24d64ad26109780910cb49e 100644 (file)
@@ -425,10 +425,6 @@ 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) );
@@ -436,10 +432,6 @@ 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;
                        }