]> git.sur5r.net Git - openldap/commitdiff
ITS#2771 fix memory usage in LDAPDN_rewrite, fix normalizer
authorHoward Chu <hyc@openldap.org>
Sat, 18 Oct 2003 05:49:58 +0000 (05:49 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 18 Oct 2003 05:49:58 +0000 (05:49 +0000)
servers/slapd/dn.c
servers/slapd/schema_init.c

index 3adfe06301f04a6ca8ea3ae75ecbc30df546d3fd..c1c1ba52cfa83330ec3ad4bbdd880318cdf0faff 100644 (file)
@@ -329,8 +329,10 @@ LDAPDN_rewrite( LDAPDN dn, unsigned flags, void *ctx )
 
 
                        if( bv.bv_val ) {
-                               ber_memfree_x( ava->la_value.bv_val, ctx );
+                               if ( ava->la_flags & LDAP_AVA_FREE_VALUE )
+                                       ber_memfree_x( ava->la_value.bv_val, ctx );
                                ava->la_value = bv;
+                               ava->la_flags |= LDAP_AVA_FREE_VALUE;
                        }
 
                        if( do_sort ) AVA_Sort( rdn, iAVA );
index 0534e2cbbee1443f6298e576e816f6c1b64d8ddf..8740744507e0ae11c6e3f26fceab760af0747846 100644 (file)
@@ -2121,7 +2121,7 @@ certificateExactNormalize(
 
        if( val->bv_val[0] != LBER_SEQUENCE ) {
                /* assume serialNumberAndIssuer */
-               return serialNumberAndIssuerNormalize(0,NULL,NULL,val,normalized,NULL);
+               return serialNumberAndIssuerNormalize(0,NULL,NULL,val,normalized,ctx);
        }
 
        p = val->bv_val;